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

    Code in the OP? What's that?

    Your code prints the lines desired, omits all other lines with a A-Z. in any other field, and prints all lines without a A-Z. (both undesired). We wish to delete only the second field if it contains a period; if it doesn't contain a period, we do nothing and move to the next line.