Perl already has the -pi options to edit files line by line, either editing in place or saving a backup file if you use -p -i.bak. Add -a to split each line, same as awk does. if you want to split on a different character other than a space, you can specify it with -F, but you want space splits
perl -pia -e"splice @F, 1, 1 if $F[1] =~ /[A-Z]\./i or $F[1] eq 'jr.' + "
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re: On Match Remove Field
by TomDLux
in thread On Match Remove Field
by rfransix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |