Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!midway!ellis.uchicago.edu!goer From: goer@ellis.uchicago.edu (Richard L. Goerwitz) Newsgroups: comp.unix.questions Subject: Re: need AWK help: lowercase, trim trailing spaces Keywords: awk Message-ID: <1991Apr21.045226.16050@midway.uchicago.edu> Date: 21 Apr 91 04:52:26 GMT References: <1817@wjvax.UUCP> <1991Apr21.015014.18228@iwarp.intel.com> Sender: news@midway.uchicago.edu (NewsMistress) Organization: University of Chicago Lines: 37 merlyn@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@uchicago.bitnet goer@sophist.uchicago.edu rutgers!oddjob!gide!sophist!goer