[alt.sources.wanted] WANTED: uuencode file splitter for large files

moore@forty2.enet.dec.com (Paul Moore) (06/06/91)

Hello,

I'm in the situation where I have to port large binary files to my system at 
home by physically carrying the stuff home on floppy disk via MSDOS. Since 
these files are often quite large (5-8 Mbyte), I run uuencode on the binary 
file and then cut the resulting text file into chunks that will fit onto a 
floppy disk.

Does anyone have a program that will do this function, so that I could, for
example, enter:

     uuencode binary_filename | <program> text_filename

and program will create as many text files with the root name of text_filename
as are required? I thought I'd ask first before writing such a program myself!

Thanks,

- Paul 

jpm@logixwi.uucp (Jan-Piet Mens) (06/06/91)

moore@forty2.enet.dec.com (Paul Moore) writes:

>I'm in the situation where I have to port large binary files to my system at 
>home by physically carrying the stuff home on floppy disk via MSDOS. Since 
>these files are often quite large (5-8 Mbyte), I run uuencode on the binary 
>file and then cut the resulting text file into chunks that will fit onto a 
>floppy disk.

>Does anyone have a program that will do this function, so that I could, for
>example, enter:

>     uuencode binary_filename | <program> text_filename

>and program will create as many text files with the root name of text_filename
>as are required? I thought I'd ask first before writing such a program myself!

	How about:
	  $ uuencode binary_file | split
	this will create as many files as necessary. These are called
	`x??'.

	At home, you get them together again with:
	  $ cat x?? | uudecode

>Thanks,
	Pleasure.

-- 
Jan-Piet Mens, Logix GmbH				    jpm@logixwi.UUCP
Moritzstr. 50, D-6200 Wiesbaden            ...!uunet!mcsun!unido!logixwi!jpm

jpr@jpradley.jpr.com (Jean-Pierre Radley) (06/22/91)

In article <1991Jun5.185116.27751@hollie.rdg.dec.com> moore@forty2.enet.dec.com (Paul Moore) writes:
>Hello,
>
>I'm in the situation where I have to port large binary files to my system at 
>home by physically carrying the stuff home on floppy disk via MSDOS. Since 
>these files are often quite large (5-8 Mbyte), I run uuencode on the binary 
>file and then cut the resulting text file into chunks that will fit onto a 
>floppy disk.
>
>Does anyone have a program that will do this function, so that I could, for
>example, enter:
>
>     uuencode binary_filename | <program> text_filename
>
>and program will create as many text files with the root name of text_filename
>as are required? I thought I'd ask first before writing such a program myself!

Csplit is probably a good way to go, but here's another, which may chop off a
line before the nl, though.

: chunk - breakup a file into SIZE chunks called OUT01, OUT02, ...
[ !-r "$1" ] && echo "Usage: $0 inputfile [prefix [size]]"
IN=$1 
OUT=${2:-chunk}
SIZE=${3:-100000}
N=0
while :
do
	T=`expr $N + 1`
	[ $T -le 9 ] && T=0$T
	dd count=1  bs=$SIZE  if=$IN  skip=$N  of=$OUT$T
	[ ! -s $OUT$T ] && rm $OUT$T && break
	N=`expr $N + 1`
done
l $OUT* $IN

Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341