Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!pyramid!pesnta!hplabs!qantel!lll-lcc!lll-crg!seismo!mcvax!ukc!stc!drm From: drm@stc.UUCP Newsgroups: net.sources Subject: Re: Cleaner-upper of mail, articles Message-ID: <327@davaar.tcom.stc.co.uk> Date: Tue, 22-Apr-86 06:26:54 EST Article-I.D.: davaar.327 Posted: Tue Apr 22 06:26:54 1986 Date-Received: Sat, 26-Apr-86 05:58:10 EST References: <817@ihwpt.UUCP> Reply-To: drm@stc.UUCP (David Monksfield) Distribution: net Organization: STC Telecoms, London N11 1HB. Lines: 32 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 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"