On Match Delete Field

Hi,

A text file contains lines of fields seperated by some delimiter; space for example; some lines but not all will have in the second field a value like an inital (e.g., A. or B. or Jr.) for those lines with such a value in field 2, we wish to have that value deleted. We also wish to do this as a one-liner. Here's what we have so far, but this omits all the other lines without a period in any field. What say you?

perl -i.bak -ane "print unless $F[2] =~ m{ \A (?: [[:alpha:]] | Jr) \. \z }xms" in.file

The following lines illustrate the issue:
Thomas, A. Alexandria S. Perl Programmer Las Vegas NV.
Williams, Jr., Michael A. C Programmer New York N.Y.
Silver, Susan Java Programmer San Jose CA
Altips, Alvin C. Tcl Programmer Chicago IL.

The challenge is to remove the A. and Jr., from the first two records, leaving the remaining fields in all lines with periods intact, and moreover leaving all other lines in the in.file. Thank you.

Well, you need a definite spec of when field 2 is to be removed, as Susan is just a longer second field. Perhaps we can key on the '.' trailing dot/stop. I am a sed guy, not su much PERL and awk:

 
sed 's/^\([^ ]* \)[^ .]*\. /\1/'

Narrative: sed reads stdin, and if there is a dot at the end of the second space separated field, removes it by replacing the first two fields plus separaors with the first field plus separator, writes all to stdout.