in reply to On Match Remove Field
I would suggest something like (untested):
perl -ane "print unless $F[2] =~ m{ \A (?: [[:alpha:]] | Jr) \. \z }xms" in.file > out.file
Update: or with in-place editing (which I didn't notice at first) (also untested):
perl -i.orig -ane "print unless $F[2] =~ m{ \A (?: [[:alpha:]] | Jr) \. \z }xms" in.file
See perlrun.
Update: BTW: What did you say about the results you got when you tried the code in the OP? You did at least try it, didn't you?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: On Match Remove Field
by rfransix (Novice) on Mar 03, 2011 at 22:33 UTC |