in reply to Delete strings
You can't delete lines from a file. You can copy a file while doing modifications to what is copied. So after opening the two files,
As a one-liner:
perl -ne"print if $f ||= /1\.0/" infile >outfile
or in-place:
perl -i.bak -ne"print if $f ||= /1\.0/" file
Update: The above were for the Windows Command shell. Below are adaptations for bash:
perl -ne'print if $f ||= /1\.0/' infile >outfile
or in-place:
perl -i~ -ne'print if $f ||= /1\.0/' file
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delete strings
by vinoth.ree (Monsignor) on Apr 10, 2009 at 08:51 UTC | |
by almut (Canon) on Apr 10, 2009 at 08:57 UTC | |
by vinoth.ree (Monsignor) on Apr 10, 2009 at 14:29 UTC | |
by lakshmananindia (Chaplain) on Apr 10, 2009 at 09:05 UTC | |
by ww (Archbishop) on Apr 10, 2009 at 12:25 UTC |