Guest_imported
New member
- Jan 1, 1970
- 0
esba (Visitor) Mar 18, 2002
I would like to add a line to my file that do not have the following pattern eg:
0 1 999 therefore if I 'll find in my a pattern on where the third field doesn't start with a 1 ie: i would add a second entry
eg:
0 1 1999 etc...
Basically I would read a file F then check for the pattern 0 1 and the check for a leading one in the third field if its missing I would add anew line ... So my new file would have:
0 1 999
0 1 1999
I have tried doing it with sed but I did't succeed:
sed -e '1,$s/0 1 [2-9]*/0 1 1/' F
sos ... Can anybody help ??
Tks!
I would like to add a line to my file that do not have the following pattern eg:
0 1 999 therefore if I 'll find in my a pattern on where the third field doesn't start with a 1 ie: i would add a second entry
eg:
0 1 1999 etc...
Basically I would read a file F then check for the pattern 0 1 and the check for a leading one in the third field if its missing I would add anew line ... So my new file would have:
0 1 999
0 1 1999
I have tried doing it with sed but I did't succeed:
sed -e '1,$s/0 1 [2-9]*/0 1 1/' F
sos ... Can anybody help ??
Tks!