PDA

View Full Version : File Splitter


Razor12911
01-12-2014, 00:35
This programs allows you to split files via command line into equal parts
and merge them whenever you want.

Usage

"Program" "command" "Original file" "File split in mb"
Split.exe s C:\File.ext 12


"Program" "command" "Split-ed file/First Split" "Original File"
Split.exe m C:\File.part1 C:\File.ext

Razor12911
01-12-2014, 01:21
Inno Setup Usage

function Splitter(OriginalFile: String; SplitSize: Integer):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 's "' + ExpandConstant(OriginalFile) + '" "' + IntToStr(SplitSize) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

function Merger(SplitFile, OriginalFile: String):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 'm "' + ExpandConstant(SplitFile) + '" "' + ExpandConstant(OriginalFile) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

Inge
01-12-2014, 01:38
Does not work for me. I see a bit of a second a Window what closed automatic. :(

Razor12911
01-12-2014, 01:48
show me your commandline

Inge
01-12-2014, 02:44
There is no Commandline. I click the Split.exe, see a Window popping up and close. Nothing more...

Razor12911
01-12-2014, 02:55
lol, it is a console app. you must command the program for it to work via CMD

here is an example

Split.exe s C:\File.ext 1024

Inge
01-12-2014, 03:35
Ok. Now I know, but don't get it to work. If you make the App a bit more easy to use I will check it out again.

Carldric Clement
01-12-2014, 06:59
Inno Setup Usage

function Splitter(OriginalFile: String; SplitSize: Integer):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 's "' + ExpandConstant(OriginalFile) + '" "' + IntToStr(SplitSize) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

function Merger(SplitFile, OriginalFile: String):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 'm "' + ExpandConstant(SplitFile) + '" "' + ExpandConstant(OriginalFile) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

How to use it the code it?
after was copy in this function,
how to extract it?

gatosky1620
01-12-2014, 14:05
how i can integrate split.exe + CIUV2 by yener script

ChronoCross
01-12-2014, 14:57
thanks Razor12911

very usefull tool

i want "Freearc Tactical Splitter (Filelist)" in console app too.

Razor12911
01-12-2014, 21:22
@Carl
You must first include the exe under files section first.

Example
Splitter(ExpandConstant('{app}\file.ext),1024);
Merger(ExpandConstant('{app}\file.part1),ExpandCon stant('{app}\file.ext));

@gatosky
I am working on the scripts right now bro.

@ChronoCross
I will see.

Carldric Clement
02-12-2014, 22:56
@Carl
You must first include the exe under files section first.

Example
Splitter(ExpandConstant('{app}\file.ext),1024);
Merger(ExpandConstant('{app}\file.part1),ExpandCon stant('{app}\file.ext));


Done of Include:

[Files]
Source: "Include\Split.exe"; DestDir: "{tmp}"; Flags: dontcopy

[Code]
function InitializeSetup: Boolean;
begin
ExtractTemporaryFile('Split.exe');
Result:=True;
end;

Razor12911
02-12-2014, 23:40
Yep.

Carldric Clement
03-12-2014, 05:25
Inno Setup Usage

function Merger(SplitFile, OriginalFile: String):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 'm "' + ExpandConstant(SplitFile) + '" "' + ExpandConstant(OriginalFile) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

Function Merger was problem.
Like Skip.

Razor12911
03-12-2014, 09:13
how i can integrate split.exe + CIUV2 by yener script
It is done, I'll just need a translated message for this:

Merging=Merging %1... (This might take a while)

The only problem is that it is not tested because I edited the script via notepad(I don't have a PC)

@Carldric
Show me how you used Merger function

Carldric Clement
03-12-2014, 14:10
It is done, I'll just need a translated message for this:

Merging=Merging %1... (This might take a while)

The only problem is that it is not tested because I edited the script via notepad(I don't have a PC)

@Carldric
Show me how you used Merger function
http://i.imgur.com/cxn72Gl.jpg

Simorq
25-04-2017, 04:54
Inno Setup Usage

function Splitter(OriginalFile: String; SplitSize: Integer):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 's "' + ExpandConstant(OriginalFile) + '" "' + IntToStr(SplitSize) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

function Merger(SplitFile, OriginalFile: String):Boolean;
var
ResultCode: Integer;
begin
if FileExists(ExpandConstant('{tmp}\Split.exe')) = False then
ExtractTemporaryFile('Split.exe');
Result:=Exec(ExpandConstant('{tmp}\Split.exe'), 'm "' + ExpandConstant(SplitFile) + '" "' + ExpandConstant(OriginalFile) + '"', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

Not Work
Please Help

78372
05-06-2017, 08:05
@Everyone The largest split size for any file is 2047 MB, so don't expect it to work for spliting files to fit in a dvd5 or something that big in size.

Gupta
05-06-2017, 09:44
try this one out
should split and merge fine for more than 1000TB of data sets
command syntax is same as Razor's one check post #1