splitting a big file with _no_ newlines in it
Larry Wall
lwall at jpl-devvax.JPL.NASA.GOV
Tue Jul 3 10:08:33 AEST 1990
In article <1990Jul2.202413.9361 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
: 4.3BSD-tahoe's (and, presumably, 4.4BSD's) version of split solves
: this problem by assuming ASCII (i.e. line-by-line) splitting in all
: cases, unless the user specifically instructs it to split by characters,
: rather than by lines.
:
: You can get this version of split from uunet.uu.net via anonymous ftp
: in the directory bsd-sources/src/usr.bin in the fiel split.c.Z.
: Unfortunately, I don't see a man page for it anywhere in the bsd-sources
: directory, so if you can't figure out how it works from reading the
: sources (it's pretty obvious), let me know in E-mail and I'll mail you
: the man page.
Or, if you have perl handy, just say
#!/usr/bin/perl
$out = "xaa";
while (read(STDIN,$foo,32768)) {
open(OUT, '>' . $out++); print OUT $foo;
}
Season to taste.
Larry Wall
lwall at jpl-devvax.jpl.nasa.gov
More information about the Comp.unix.questions
mailing list