a SED question

S. Luke Jones slj at mtung.ATT.COM
Tue Dec 6 07:21:59 AEST 1988


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 at mtung.att.com  -or-  ...!att!mtung!slj   (201)-957-2733



More information about the Comp.unix.questions mailing list