need AWK help: lowercase, trim trailing spaces
Richard L. Goerwitz
goer at ellis.uchicago.edu
Sun Apr 21 14:52:26 AEST 1991
merlyn at iwarp.intel.com (Randal L. Schwartz) writes:
>
>while (<>) {
> s/([A-Z]{3,})/\u\L$1$2/g;
> ($name,$address1,$address2,$city,$zip) = unpack("A10A19A17A24A*",$_);
> print "$name\n";
> print "$address1\n";
> print "$address2\n" if $address2;
> print "$city $zip\n";
> print "\n";
>}
>
>Works just fine on your test data.
No, no! The gentleman said quite plainly that he wanted his data to
look like this:
Company1
28 Fulling
P O Box 3608
Harrisburg PA 17105
Company2
500 Elm
Milwaukee WI 53122
Company3
13500 Central
P O Box 655303
Dallas TX 75265-5303
Did you actually try running your perl code?
--
-Richard L. Goerwitz goer%sophist at uchicago.bitnet
goer at sophist.uchicago.edu rutgers!oddjob!gide!sophist!goer
More information about the Comp.unix.questions
mailing list