Path: utzoo!utgpu!watmath!clyde!att!mtung!slj From: slj@mtung.ATT.COM (S. Luke Jones) Newsgroups: comp.unix.questions Subject: one more SED/AWK question Message-ID: <1076@mtung.ATT.COM> Date: 7 Dec 88 12:32:03 GMT Reply-To: slj@mtung.UUCP (S. Luke Jones) Organization: AT&T ISL Middletown NJ USA Lines: 26 I think I provided too much detail in my previous posting. Let's assume we have a text file blah blah SUDAN blah blah blah CZECHOSLOVAKIA blah blah blah MALAYSIA blah blah blah CANADA blah blah blah PERU blah Suppose I want to grab everything between CZECHOSLOVAKIA to PERU, not counting PERU. I *don't* know anything about the order of countries in this file and I *don't* know that CANADA is the line before PERU. sed -n '/CZECH/,/PERU/p' gives me what I want except it includes the line with PERU. By contrast, awk '/CZECH/,/PERU/' prints precisely the lines I want, i.e., it does not include PERU. Any suggestions? -- S. Luke Jones AT&T Infor#####Bell Labs 200 Laurel Avenue, Room MT 2E-337, Middletown, NJ 07748 slj@mtung.att.com -or- ...!att!mtung!slj (201)-957-2733