in reply to problem with deleting a row
The original file is copied to test.txt.orig and the new file has all lines that do not begin (that's what the ^ anchor is for) with lb348 followed by a comma. (The -n says to loop over all the lines in the filenames given in the argument list, so this works on many files at once. The -e says to execute the bit of code between the quotes.)perl -i.orig -ne 'print unless /^lb348,/' test.txt
If you're sysadmining, slinging files around as quick as you can, learning to use the command line will save you time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem with deleting a row
by brianMonk (Initiate) on Nov 21, 2013 at 17:10 UTC | |
by Laurent_R (Canon) on Nov 21, 2013 at 18:37 UTC | |
by Ea (Chaplain) on Nov 22, 2013 at 11:04 UTC | |
by Laurent_R (Canon) on Nov 23, 2013 at 16:56 UTC | |
by brianMonk (Initiate) on Nov 21, 2013 at 18:42 UTC | |
by Laurent_R (Canon) on Nov 21, 2013 at 19:03 UTC | |
by brianMonk (Initiate) on Nov 21, 2013 at 19:56 UTC | |
by Laurent_R (Canon) on Nov 23, 2013 at 11:57 UTC |