06-03-2009, 07:11 PM
I just found your other post and tested it here is whole code it works
Function Function4
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