Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!jpradley!jpr From: jpr@jpradley.jpr.com (Jean-Pierre Radley) Newsgroups: alt.sources.wanted Subject: Re: WANTED: uuencode file splitter for large files Message-ID: <1991Jun22.010755.7867@jpradley.jpr.com> Date: 22 Jun 91 01:07:55 GMT References: <1991Jun5.185116.27751@hollie.rdg.dec.com> Organization: Unix in NYC Lines: 37 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 | 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