Hi i made a script which is take a data from my db and store it in to a .csv file
the contents of .csv file:
1-Mar-12,183991,1017 --- --- more columns are there
2-Mar-12,,,,,,,,,,,,
3-Mar-12,,,,,,,,,,,,
4-Mar-12,,,,,,,,,,,,
5-Mar-12,,,,,,,,,,,,
6-Mar-12,,,,,,,,,,,,
when i trying to replace a string depends upon the date it will add all corresponding dates.
for example
i want to replace a string on 2-Mar-12
command is
sed "s/$finddate/$finalstring/" dailyrep.csv > DailyReport_$datenow.csv
sed "s/2-Mar-12/$mydata/" origfile > fileto store
Output is
2-Mar-12,177950,8159,95.62%,6785711
3-Mar-12,,,,,,,,,
4-Mar-12,,,,,,,,,
5-Mar-12,,,,,,,,,
6-Mar-12,,,,,,,,,
11-Mar-12,,,,,,,,,,,,,,,,,,,,
12-Mar-12,177950,8159,95.62%,
21-Mar-12,,,,,,,,,,,,,,,,,,,
22-Mar-12,177950,8159,95.62%
I want to replace only that particular date not all occurrence of that.