Path: utzoo!utgpu!watmath!clyde!att!mtung!slj From: slj@mtung.ATT.COM (S. Luke Jones) Newsgroups: comp.unix.questions Subject: a SED question Keywords: address-range, 2-addresses Message-ID: <1075@mtung.ATT.COM> Date: 5 Dec 88 21:21:59 GMT References: <32039@gt-cmmsr.GATECH.EDU> Reply-To: slj@mtung.UUCP (S. Luke Jones) Organization: AT&T ISL Middletown NJ USA Lines: 30 Here is my problem: I have a file composed of multi-line records. Continuation lines begin with arbitrary white space. I want to extract *some* of the records. for example: In this file, the "Here is my..." and "for example" lines begin multi-line records. Suppose the records I want are those that begin with an uppercase letter ("Here...") sed -n -e '/^[A-Z]/,/^[^(spc)(tab)]/p' file will print each such record, but would also get the "for..." line of the second record. sed -n -e '/^[A-Z]/,/^[(spc)(tab)]/p' file will not get "for..." but will only get the first following line that begins with white space. I've tried combinations and permutations of -n and '/pat/,/pat/!d' and I give up. Why oh why can't SED act like AWK does and *not* print this line??? -- 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