05-21-2009
1,
0
Join Date: May 2009
Last Activity: 21 May 2009, 8:14 PM EDT
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
replace 9- 2ith 2009-
hi guys,
i am tryin with this code:
cat final.csv | while read line
do
yr=`echo $line | cut -d"," -f2 | cut -d "-" -f1`
newyr=`expr "$yr" + 2000`
dash="-"
yr1=`echo $yr$dash`
newyr1=`echo $newyr$dash`
sed 's/$yr1/$newyr1/g' final.csv
done
final.csv:
1007004604,9-7
1007014100,9-7
1006004901,9-7
1006005000,9-7
1005017506,9-7
1006011004,9-7
1007017805,9-7
1007020200,9-7
1006012900,9-7
1007004222,9-7
1006006700,9-7
1005017119,9-7
1006006900,9-7
1006013404,9-7
where 9-year, 7-month
i want to replace year-9 as 2009 and month-7 as 07
please help me wid his piece of code!!!
thx a lot!!!