View previous topic :: View next topic |
Author |
Message |
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sat Oct 24, 2015 10:32 pm Post subject: File splitter/joiner help [SOLVED] |
|
|
Hello to all
I have to create a program to split merge large files in file size smaller than I decide the size, unfortunately for me I already stranded when the file to be shared , can someone help me politely handing me that maybe a script running does this type of operation to adapt it to my needs and study it to learn?
I would be very grateful
Greetings |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Thu Nov 05, 2015 8:50 pm Post subject: |
|
|
I did writed this solution
Any suggestion to make it more fast?
Code: | TITLE SPLITTER
OPTION DECIMALSEP,","
DIALOG CREATE,Splitter,-1,0,320,140
DIALOG ADD,EDIT,origine,35,5,264,19,
DIALOG ADD,BUTTON,borigine,33,273,37,24,...
DIALOG ADD,EDIT,desti,60,11,257,19,
DIALOG ADD,BUTTON,bdesti,60,274,37,24,...
DIALOG ADD,BUTTON,go,-2,148,36,24,go
DIALOG ADD,EDIT,div,4,206,89,19,4095737856
DIALOG ADD,EDIT,vedi,89,12,63,46,,,MULTI
DIALOG ADD,PROGRESS,pr,102,80,150,24,0,,HORIZONTAL
DIALOG ADD,TEXT,info,81,102,152,15,info
DIALOG SHOW
:LOOP
WAIT EVENT
%e = @event()
GOTO %e
:BORIGINEBUTTON
%o = @filedlg(*.*)
IF @ok()
DIALOG SET,origine,%o
END
GOTO LOOP
:bdestiBUTTON
%d = @dirdlg(Sele folder,c:\,1)
IF @ok()
DIALOG SET,DESTI,%d
END
GOTO loop
:GOBUTTON
%%Buffer = 9000
%%fo = @dlgtext(ORIGINE)
%x = @prod(@dlgtext(DIV),%%Buffer)
%y = @file(%%Fo,Z)
%%Pezzo = 0
%%IN = @new(FILE,%%Fo,READ)
%%Fnew = @dlgtext(Desti)\@name(%%fo).@ext(%%Fo)
%%OUT = @new(FILE,%%Fnew.%%Pezzo,CREATE)
%j = 1
%s = 0
%p = 0
%v = 0
SEEKFILE %%In,START
WHILE @not(@filepos(%%IN,EOF))
%b = @read(%%In,30720,HEX)
SEEKFILE %%In,%v
IF @greater(@div(@filepos(%%IN),%x),0)
CLOSEFILE %%Out
%%Pezzo = @succ(%%Pezzo)
%%Out = @New(FILE,%%Fnew.%%Pezzo,CREATE)
IF @not(@ok())
WARN Error!
STOP
END
%p = 0
END
IF %b
WRITE %%OUT,%b,HEX
END
%p = @sum(%p,%%Buffer)
%j = @succ(%j)
%s = @filepos(%%IN)
%v = @sum(%v,%%Buffer)
DIALOG set,vedi,@div(@prod(%s,100),%y)"%"@cr()@cr()%s
DIALOG SET,PR,@div(@prod(%s,100),%y)
WEND
CLOSEFILE %%In
CLOSEFILE %%Out
INFO END JOB
GOTO LOOP
:CLOSE
STOP
|
|
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Thu Nov 05, 2015 10:51 pm Post subject: |
|
|
Not really! This should execute somewhat quickly. Is this not the case? |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Nov 06, 2015 12:15 pm Post subject: |
|
|
Code corrected (was bugs)
Code: | DIALOG ADD,BUTTON,bdesti,60,274,37,24,...
DIALOG ADD,BUTTON,go,-2,148,36,24,go
DIALOG ADD,EDIT,div,4,206,89,19,4095737856
DIALOG ADD,EDIT,vedi,89,12,63,46,,,MULTI
DIALOG ADD,PROGRESS,pr,102,80,150,24,0,,HORIZONTAL
DIALOG ADD,TEXT,info,81,102,152,15,info
DIALOG SHOW
:LOOP
WAIT EVENT
%e = @event()
GOTO %e
:BORIGINEBUTTON
%o = @filedlg(*.*)
IF @ok()
DIALOG SET,origine,%o
END
GOTO LOOP
:bdestiBUTTON
%d = @dirdlg(Select destination folder,c:\,1)
IF @ok()
DIALOG SET,DESTI,%d
END
GOTO loop
:GOBUTTON
%%Buffer = 2048
%%fo = @dlgtext(ORIGINE)
%x = @prod(@dlgtext(DIV),%%Buffer)
%y = @file(%%Fo,Z)
%%Pezzo = 0
%%IN = @new(FILE,%%Fo,READ)
%%Fnew = @dlgtext(Desti)\@name(%%fo).@ext(%%Fo)
%%OUT = @new(FILE,%%Fnew.%%Pezzo,CREATE)
%j = 1
%s = 0
%p = 0
%v = 0
SEEKFILE %%In,START
WHILE @not(@filepos(%%IN,EOF))
IF @equal(%p,%x)
CLOSEFILE %%Out
%%Pezzo = @succ(%%Pezzo)
%%Out = @new(FILE,%%Fnew.%%Pezzo,CREATE)
IF @not(@ok())
WARN Error!
STOP
END
%p = 0
END
IF %b
WRITE %%OUT,%b,HEX
END
%p = @sum(%p,%%Buffer)
%j = @succ(%j)
%s = @filepos(%%IN)
%v = @sum(%v,%%Buffer)
DIALOG set,info,@div(@prod(%s,100),%y)"%"-%s
DIALOG SET,PR,@div(@prod(%v,100),%y)
%b = @read(%%In,%%Buffer,HEX)
SEEKFILE %%In,%v
WEND
CLOSEFILE %%In
CLOSEFILE %%Out
INFO END JOB
GOTO LOOP
:CLOSE
STOP |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|