torels Posted June 18, 2008 Posted June 18, 2008 Hi there The title of the topic says it all... how do I split a file in a number of smaller files (of hte same size) ? thanks in advance Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org
rudi Posted June 18, 2008 Posted June 18, 2008 Very fast and free is the tool ChainSaw.exe.Files > 4Gig are fine.Simply drag/drop the files on the Icon. Maybe it can use command line params, pls check out yourself.a merge tools is also provided.Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
monoceres Posted June 18, 2008 Posted June 18, 2008 (edited) I found an UDF http://www.autoitscript.com/forum/index.ph...63&hl=Split Edited June 18, 2008 by monoceres Broken link? PM me and I'll send you the file!
Kip Posted June 18, 2008 Posted June 18, 2008 expandcollapse popup$B = 0 $KB = 1 $MB = 2 $GB = 3 $TB = 4 $iPartSize = Lenght(1,$MB) $sPath = FileOpenDialog("Open file to split",@DesktopDir,"All files (*.*)") If @error Then Exit $hFile = FileOpen($sPath,16) $sRead = FileRead($hFile) FileClose($hFile) $iTotalLenght = BinaryLen($sRead) $iPartCount = $iTotalLenght/$iPartSize $sPathSplit = StringSplit($sPath,"\") DirCreate($sPath&".part") For $i = 1 to Ceiling($iPartCount) $hPartFile = FileOpen($sPath&".part\"&$sPathSplit[$sPathSplit[0]]&"."&$i&".part",16+2) FileWrite($hPartFile, BinaryMid($sRead,($i-1)*$iPartSize+1,$iPartSize)) FileClose($hPartFile) Next Func Lenght($iLen, $iType) Return 1024^$iType * $iLen EndFunc MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
Andreik Posted June 25, 2008 Posted June 25, 2008 expandcollapse popup$B = 0 $KB = 1 $MB = 2 $GB = 3 $TB = 4 $iPartSize = Lenght(1,$MB) $sPath = FileOpenDialog("Open file to split",@DesktopDir,"All files (*.*)") If @error Then Exit $hFile = FileOpen($sPath,16) $sRead = FileRead($hFile) FileClose($hFile) $iTotalLenght = BinaryLen($sRead) $iPartCount = $iTotalLenght/$iPartSize $sPathSplit = StringSplit($sPath,"\") DirCreate($sPath&".part") For $i = 1 to Ceiling($iPartCount) $hPartFile = FileOpen($sPath&".part\"&$sPathSplit[$sPathSplit[0]]&"."&$i&".part",16+2) FileWrite($hPartFile, BinaryMid($sRead,($i-1)*$iPartSize+1,$iPartSize)) FileClose($hPartFile) Next Func Lenght($iLen, $iType) Return 1024^$iType * $iLen EndFunc If I want to create file again from splitted files, what should I do? Thanks in advance!
Xandl Posted June 25, 2008 Posted June 25, 2008 Hello,I know that writing own scripts is fun and educational,but if you need to split laaarge files, you could use the winrarcommand line tool to split/rejoin these files.It can be found at http://www.win-rar.com/download.html.Here is an example batch file to split files with rar.exe:expandcollapse popup@echo off :: -------------------------------------------------------------------------- :: file path\name to split set file=%1 :: filename only, dont touch set fName=%~n1 :: output directory, path to put rar split files set out=.\out :: rar binary set rar=.\bin\rar.exe :: output split size, in rar size format set size=32000k ::set size=12000k :: 0-5, 0=store set compression=0 : --------------------------------------------------------------------------- if "%file%"=="" goto noparam if not exist %file% goto nofile call :log start split on file %~n1, size: %size% %rar% a -v%size% -m%compression% %out%\%fName% %file% call :log done split file %~n1 goto end :noparam call :log Error: no path\file name parameter given to splice goto end :nofile call :log Error: file %file% not found goto end :log echo %DATE% %TIME% - %* goto :EOF :endUsage: scp_rarSplit.cmd drive:\path\to\bigfile.extThe split files go to %out%, configured in the batch file.Just look at the first few lines in the batch, to configure it for your purposes.ciaoXandl
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now