[net.sources] Cleaner-upper of mail, articles

drm@stc.UUCP (04/22/86)

I have been using a simple lex program to tidy up
mail and mailbox-format news files.  This has the advantages that
(a) it is compiled and therefore runs faster than a shell script
(b) it defines the header lines you want rather than those you don't.

It can be easily modified to deal with different required header lines
or different file formats. (the version below assumes a mail header
ie. From<space> to start and a blank line to end the header section).

This is NOT in SHAR format - just save to "sourcefile",
extract the part between cuts and 

	lex sourcefile; cc -o mtidy lex.yy.c -ll

or something similar.

----------------- cut ----------------
%%
		int body;
^From" ".*\n	{ body=0; ECHO; }
^\n		{ body=1; ECHO; }
^(Subject:|Status:|To:).*\n  ECHO;
^.+\n		if (body) ECHO;
----------------- cut ----------------

--
	Cheers,

	Dave Monksfield
	...!ukc!stc!drm

"Oh dear, I think reality is on the blink again"