Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: merging 2 files Keywords: sed awk perl join Message-ID: <102007@convex.convex.com> Date: 4 May 90 05:24:00 GMT References: <757@sagpd1.UUCP> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 49 In article <757@sagpd1.UUCP> jharkins@sagpd1.UUCP (Jim Harkins) writes: |I need to change a lot of words with mixed upper and lower case letters into |words of all lower case letters, from there I'm going to make a sed script |to actually modify the words in our source. So how do I make my list? |For example, I want to convert the list | |FooBar |blaTZ |GRMblE |WhEe | |into | |FooBar foobar |blaTZ blatz |GRMblE grmble |WhEe whee | |(from this second list it's trivial to create lines of sed commands like |'/FooBar/foobar/g', and there are around 800 words in my list) | |Right now I have 2 files, one with the upper/lower case names, the second |with just lower case names. I think I've been going down the wrong path |here though. I'm now thinking of using sed directly but I'm no sed wizard. |Join may also do the job but I'm having trouble deciphering the man page |and none of my experiments to date have remotely resembled what I'm after. Just for the record, I really did play around with sed's y operator a bit and swapping pattern and hold spaces before throwing up my hands and doing it the easy way. Use % perl -n foo.pl where foo.pl consists of: chop; print $_, " "; y/A-Z/a-z/; print $_, "\n"; I'm not sure how you plan to merge two files, but I think it'll end up being easier in perl than in sed. --tom -- Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in : Editor too big!"