Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!lacey From: lacey@batcomputer.tn.cornell.edu (John Lacey) Newsgroups: comp.unix.questions Subject: Re: Finding words in paragraphs Message-ID: <8425@batcomputer.tn.cornell.edu> Date: 17 Jul 89 20:30:14 GMT References: <8421@batcomputer.tn.cornell.edu> <10545@smoke.BRL.MIL> Reply-To: lacey@tcgould.tn.cornell.edu (John Lacey) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 23 In article <10545@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <8421@batcomputer.tn.cornell.edu> lacey@tcgould.tn.cornell.edu (John Lacey) writes: >>Awk is what you want in this case. Try something like this: >> awk 'BEGIN { FS = ""; RS = "\n"} /the-word-here/' the-filename-here > > [A nice demonstration that this doesn't work.] Yes, I mistyped the line. It should be { FS = "\n"; RS = "" }. I _did_ say "something like this" :-). But, hey, Doug, why didn't you just post a fix to this? [ :-) ] It's a simple typo, and you took the time to test it and post a demonstration that it didn't work. Anyhows, switching the values of the field and record separators will fix this "code" right up. Bythe, the default values for Awk are FS = " ", and RS = "\n". Cheers, -- John Lacey | Internet: lacey@tcgould.tn.cornell.edu running unattached | BITnet: lacey@crnlthry | UUCP: cornell!batcomputer!lacey "Whereof one cannot speak, thereof one must remain silent." ---Wittgenstein