0README

./SED
|-- 0Postings		directory - statement of problem; responses ....
|   |-- postings.txt		text file summary of postings
|   `-- sed-[ab]-[12].html	3 html files of postings
|-- 0README		this file
|-- dewit.sed		sed solution - Leo de Wit
|-- jar.sed		sed solution - John Rupley
|-- litmaath.sed	sed solution - Maarten Litmaath
|-- jar.l		lex solution - John Rupley
|-- a.out		executable for lex solution
`-- testfile		test file, to be filtered by sed or lex solutions



Statement of problem:
-------
	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
-------


For discussion and solutions, see:
	0Postings/postings.txt 
or, more readable and more complete,
	0Postings/sed-a-[12].html
	0Postings/sed-b-1.html


Four solutions selected, i.e., given as files in this directory:

	dewit.sed
	jar.sed
	litmaath.sed
	jar.l -> a.out


To test them:
	a.out <testfile >scr
	dewit.sed <testfile | diff - scr
	jar.sed <testfile | diff - scr
	litmaath.sed <testfile | diff - scr
		[litmaath.sed misses a sequence]


NOTE that the lex solution is simplest - lex fits best a problem with
matching of patterns that cross line ends.


To compile lex code:
	makelex <jar.l 
	or
	lex jar.l; cc lex.yy.c -ll; strip a.out


testfile =  file used for testing of solutions:
-------start
testing1
PROMPT>
>
testing4
PROMPT>
>
<
xxxPROMPT>
>
<
testing8
PROMPT>

aaaa
bbbb
PROMPT>
>
<
testing14
PROMPT>
>
<
PROMPT>
cccc
dddd
PROMPT>
>
PROMPT>
>
<
testing22
PROMPT>
>
-------end


John Rupley
 rupley@u.arizona.edu -or- jar@rupley.com
 30 Calle Belleza, Tucson AZ 85716 - (520) 325-4533; fax - (520) 325-4991
 Dept. Biochemistry & Molecular Biophysics, Univ. Arizona, Tucson AZ 85721
