From req@warwick.UUCP Wed Nov 19 14:16:02 1986
Path: mcvax!ukc!warwick!req
From: Russell Quin <req@warwick.UUCP>
Newsgroups: net.sources
Subject: mailsplit (or "fsplit") -- split files by line or pattern
Message-ID: <453@ubu.warwick.UUCP>
Date: 19 Nov 86 20:16:02 GMT
Reply-To: req@warwick.UUCP (Russell Quin)
Organization: Computer Science, Warwick University, UK
Lines: 485
Posted: Wed Nov 19 14:16:02 1986

Mailsplit splits up a file (or lots of files) into lots of little files.  It
reads its input a line at a time, and starts a new output file when
	1) the input line matches a pattern, or
	2) there have been n lines written to the current output file.

You can use it to split a mailbox or an archive of news articles into one
article per file, for example.  In fact, you can do this with about 5 lines of
awk, but you run into problems with long lines (and speed, if it bothers you!).

Source, Makefile and manual entry enclosed.
1:	Edit the Makefile: you'll need to alter the "R=/usr/local" if you don't
	want mailsplit to live in /usr/local/usr/bin.  You may also want to
	rename it "fsplit".  I prefer "fsplit", but it's called mailsplit for
	historical reasons.

2:	make mailsplit

3:	have a play with it & satisfy yourself that it behaves reasonably

4:	make install

Make "install" will do a "$(MAKE) $(CLEAN)" afterwards.  If you don't want to
remove the binary, say
	CLEAN="" make install
at step 4.

I shall be leaving Warwick to move to a new job at the end of the week, so
although mail will be forwarded (& I'd be glad of any changes that you needed
to make), I may take a while to respond!

Russell

-- 
ARPA		req%uu.warwick.ac.uk@ucl-cs.arpa
EARN/BITNET	req%UK.AC.WARWICK.UU@AC.UK
JANET		req@uk.ac.warwick.uu
UUCP		seismo!mcvax!ukc!warwick!req  (req@warwick.UUCP)
PHONE		+44 203 523193 Until 20th November.

No new FRPList requests, please.  Details in net.games.frp.  Thanks!
The BITNET path only works from sites that have AC.UK in their tables.  Sorry.

