🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3537

Re: SED Question

#3537
From: 3929]
Date: Tue, 11 Apr 1989 16:29
29 lines
1628 bytes
In article<2360001@hpcuhc.HP.COM> smaxwell@hpcuhc.HP.COM (Susan Maxwell) writes:
>Got a sed question for you:  I'm creating a sed filter to mask out and
>delete unwanted characters in a trace file.  I'm having trouble with this
>configuration:
>        LINE I:    PROMPT>
>        LINE I+1:  >
>        LINE I+2:  <
>Whenever I see this series, I want to delete ALL THREE lines.  I can't
>create a pattern /PROMPT\>\\n\>\\n\</d   as far as I can tell, because
>sed won't allow patterns to span lines.  Is there a way to do this, without
>resorting to awk or ed?   
>
>Susan Maxwell

cat "file to filter" | sed -e "/^PROMPT>/,/^</d"

should do the trick.  It says:  delete (inclusive) all lines from one which
starts with the text "PROMPT>" and one which starts with the text "<".
Note that you can do

sed -e "/^PROMPT>$/,/^<$/d" if you need the lines to contain exactly that
text.


Brian R. Gilstrap                          Southwestern Bell Telephone
One Bell Center Rm 17-G-4                  ...!ames!killer!texbell!sw1e!uucibg
St. Louis, MO 63101                        ...!bellcore!texbell!sw1e!uucibg
(314) 235-3929
#include <std_disclaimers.h>
Technical Details
Message-ID: <1481@sw1e.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!ucbvax!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!sw1e!uucibg
References: <2360001@hpcuhc.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!ucbvax!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!sw1e!uucibg
From: uucibg@sw1e.UUCP (3929])
Newsgroups: comp.editors
Subject: Re: SED Question
Message-ID: <1481@sw1e.UUCP>
Date: 11 Apr 89 16:29:02 GMT
References: <2360001@hpcuhc.HP.COM>
Reply-To: uucibg@sw1e.UUCP (Brian Gilstrap [5-3929])
Organization: Southwestern Bell Telephone Co
Lines: 29