Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
The syntax is same.
For i=0 to 10
.........
Next
Regards,
Kaushik Solanki
HI
This is one of the example for retrieve all files in folder by using for loop in script
Sub loadfiles(Files)
For Each file in FileList('$(Files)' & '\*.*');
TestLoad:
LOAD '$(file)' AS FilePath,
if(Len(SubField('$(file)','.',-1)) < 8,SubField('$(file)','.',-1),'No Extension') AS FileExtension,
FileSize('$(file)') AS FileSize,SubField('$(file)','\',SubStringCount('$(file)','\')+1) As FileName,
FileTime('$(file)') AS FileTime AutoGenerate 1;
NEXT file;
For Each subdir in DirList('$(Files)' & '\*');
CALL subFunction('$(subdir)')
NEXT subdir;
End Sub
SUB subFunction(Subdir)
For Each sub in DirList('$(Subdir)')
CALL loadfiles('$(sub)')
NEXT sub;
End Sub
Call loadfiles('E:\Qlikview -11')
Drop Tables "*";
There are many ways to do this. For an overview, see Loops in the Script.
HIC