[comp.unix.questions] splitting a big file with _no_ newlines in it

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (07/03/90)

In article <1990Jul2.202413.9361@athena.mit.edu> jik@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@jpl-devvax.jpl.nasa.gov

cpcahil@virtech.uucp (Conor P. Cahill) (07/03/90)

In article <62@ai.etl.army.mil> anneb@ai.etl.army.mil (Anne Brink) writes:
>We have a user here who is trying to download some very large data files.
>(33.4 MB and up).  He's trying to download them via a PC using kermit, which
>means splitting them into manageable pieces.  The hangup is that split will not
>split the files into more than 1 piece.  I suspect that this is because the
>files have 0 lines! (Or so claims wc -l)  They're just streams of raw ascii
>data, consisting of hundreds of little records. 

Since you are going to be downloading the files anyway, I would suggest the
following:

	compress < file | btoa | split


Which can be reversed on the receiving machine.
-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

gwyn@smoke.BRL.MIL (Doug Gwyn) (07/04/90)

In article <8577@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>Or, if you have perl handy, just say

You can also use "dd" in a shell loop.