Splitting Big Files

govern at houxf.UUCP govern at houxf.UUCP
Tue Aug 16 23:29:23 AEST 1983


<Sorry to post this to the net, but I couldn't get ARPANET to
deliver it for me.  Somebody had a file that was too big too read
using ed.>

To: harpo!seismo!hao!hplabs!sri-unix!CMCNATT at stl-host1
References: <3944 at sri-arpa.UUCP>

You didn't say which version of UNIX you have, but there are several
programs available that may be useful.

bfs = big file scanner is a slightly dumber version of ed that uses
	a small buffer to hold part of the file, but leaves most of it out
	on disk.  It's fairly good for minor work of the type you
	probably need to do.

split [-n] file [ name ]
	splits a file into n-line pieces (default n=1000), named
	<name>aa, <name>ab, ..., (default name="x").  File can be
	standard input or -.

vi	If you are using Berkeley UNIX 4.1 or better, and have
	enough space in /tmp, you should be able to vi immense
	files;  you may have to go into csh and raise some limits to
	do it, but this isn't hard if your system is configured for
	large swap space.  Even on USG, vi can handle much bigger
	files  than ed can.

csplit is a fancy program to split up files based on context.

head and tail can be used to split the file in two, if that will do
	the job.  head is a Berkeley program, but trivial to write;
	it cats the first n lines of the file and exits.

				Bill Stewart
				ucbvax!ihnp4!houxf!govern
				decvax!harpo!houxf!govern



More information about the Comp.unix.wizards mailing list