Quote:
|
Originally Posted by IHulky
Hi everyone, I hope that someone can help me out:
In the following line:
PRIHDR;2809999444;2007 6.1;20070423;9;;4021473000003;;4021473000003;8714231530688;EUR;;
The output should be:
PRIHDR;2809999444;2007 6.1;20070423;4;;4021473000003;;4021473000003;8714231530688;EUR;;
I've tried some variations on the following command:
sed 's/;9;;/;4;;' <oldfile>newfile
When I run this command it tells met what to do with the ";" how can I solve this issue?
Thanks in advance,
IHulky
p.s. the other lines in the document (line 2 and further) have to be copied as well to the new file.
|
Add slash
Code:
sed '/^PRIHDR/s/;9;;/;4;;/' <oldfile >newfile
mv newfile oldfile