Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!tank!sophist!goer From: goer@sophist.uucp (Richard Goerwitz) Newsgroups: comp.unix.questions Subject: Re: merging 2 files Keywords: sed awk perl join Message-ID: <9192@tank.uchicago.edu> Date: 8 May 90 19:57:51 GMT References: <757@sagpd1.UUCP> <102007@convex.convex.com> <7@stoat.warwick.ac.uk> Sender: news@tank.uchicago.edu Reply-To: goer@sophist.UUCP (Richard Goerwitz) Organization: University of Chicago Lines: 47 On converting ><|FooBar ><|blaTZ ><|GRMblE ><|WhEe into ><|FooBar foobar ><|blaTZ blatz ><|GRMblE grmble ><|WhEe whee using the Perl script - >< chop; >< print $_, " "; >< y/A-Z/a-z/; >< print $_, "\n"; Rob McMahon (cudcv@warwick.ac.uk) writes: >I know perl is wonderful, and I do use it a lot, but I can't help feeling that > > tr '[A-Z]' '[a-z]' < file | lam file -s " " - > >is easier (if you have `lam' I suppose, but there's an "if you have `perl'" >too ...). If we are into the right-tool-for-the-job game, let me just point out that Icon will do the same job as well: procedure main() every line := !&input do write(line," ",map(line)) end This'll run about the same speed as the Perl script. The point is that there is no reason to perversely superimpose string- processing tasks on a diverse set of utilities, when there exist inter- nally consistent, fast, elegant (and free) methods for solving these same problems. -Richard L. Goerwitz goer%sophist@uchicago.bitnet goer@sophist.uchicago.edu rutgers!oddjob!gide!sophist!goer