[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: file splitter and merger??



perhaps it was mentioned already, but "rar" (from FreshRPMs) compresses 
AND splits files into multiple parts.

I've used it for moving large files (> 4 GB) across fat32 partitions.

An additional benefit is that the archiver is truly cross-platform, so 
moving files between Windows and 'nix is simplified.

Jeff Krebs


* Dave Ihnat (dihnat dminet com) wrote:
> On Thu, Nov 29, 2007 at 10:35:32AM +1100, Lux Zhang wrote:
> > what are tools to split a large file (etc 700mb a.avi) into small
> > pieces and then the merger to merge them?
> 
> People have suggested 'split' and 'cat'.  These are at best marginal, at
> worst simply won't work for binary files.
> 
> Look for a script called 'bsplit'.  If you can't find a distributed version,
> something like the attached will work.
> 
> Cheers,
> --
> 	Dave Ihnat
> 	President, DMINET Consulting, Inc.
> 	dihnat dminet com

> #
> # bsplit [n] name
> #
> # Breaks a file into N-block parts, where a block is 512 bytes
> #
> # Author: Dave Ihnat.  Released as a work in the Public Domain.
> 
> BCOUNT=0
> FCOUNT=0
> BSKIP=0
> 
> if [ $# -eq 2 ]
> then
> 	BCOUNT=$1;
> 	shift;
> else
> 	BCOUNT=100;
> fi;
> 
> OUTFILE=$1;
> PREFIX=00
> 
> while [ TRUE ]
> do
> 	echo "$OUTFILE.${PREFIX}${FCOUNT}"
> 
> #	dd of=$OUTFILE.${PREFIX}${FCOUNT} skip=$BSKIP count=$BCOUNT
> 	dd of=$OUTFILE.${PREFIX}${FCOUNT} count=$BCOUNT
> 
> 	if [ $? -ne 0 ]
> 	then
> 		break;
> 	fi;
> 
> 	if [ ! -s $OUTFILE.${PREFIX}${FCOUNT} ]
> 	then
> 		rm $OUTFILE.${PREFIX}${FCOUNT}
> 		break;
> 	fi;
> 
> 	FCOUNT=`expr $FCOUNT + 1`
> 	if [ "$FCOUNT" -gt 99 ]
> 	then
> 		PREFIX=""
> 	elif [ "$FCOUNT" -gt 9 ]
> 	then
> 		PREFIX="0"
> 	fi;
> 
> 	BSKIP=`expr $BSKIP + $BCOUNT`
> done
> 
> exit 0

> -- 
> fedora-list mailing list
> fedora-list redhat com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]