Posts: 128
Threads: 48
Joined: Jan 2007
Hi,
is it possible to use a string in destFolder function so i can use a filename i stored earlier to create files?
or is there another way to manage this..
code used now is:
destFolder+"\file-%i.txt"
what i like is the file part replaced by something stored in string...
THX
Posts: 160
Threads: 43
Joined: Sep 2007
Iv never used destFolder so dunno how to test but i think this might work
Function
Function3
str FileName="";str a="\";str b="-%i.txt"
a+FileName;a+b
destFolder+ a
Posts: 160
Threads: 43
Joined: Sep 2007
I just found your other post and tested it here is whole code it works
Function
Function4
;change these
str sFile="$desktop$\led.txt" ;;large file
str destFolder="$desktop$\936543" ;;destination folder
int nLinesInFile=3000 ;;number of lines in small files
int enable=1 ;;change to 1 to create the files. By default, just displays file paths.
;____________________________________
if(enable) mkdir destFolder
str FileName="xx";str a="\";str b="-%i.txt"
a+FileName;a+b
destFolder+a
str s s1 s2 s3
s1.getfile(sFile)
int i j
foreach s s1
,s2.addline(s)
,i+1
,if(i=nLinesInFile)
,,;g1
,,j+1
,,s3.format(destFolder j)
,,out "%s (%i lines)" s3 i
,,if(enable) s2.setfile(s3)
,,s2=""
,,i=0
if(s2.len) goto g1