Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Is it possible to load the filenames of the files present in a folder irrespective of whether it is in csv, xls or xlsx format.
Thanks,
Asma
Hi Asma,
sure it is possible. Have a look at the Filename() and related functions. You can parse through all that is inside a directory and find out the name, filetype or others.
HTH
look up an example of For Each in Help(F1) Section
FOR Each a in 1,3,7,'xyz'
LOAD * FROM file$(a).csv;
NEXT
// list all QV related files on disk
SUB DoDir (Root)
FOR Each Ext in 'qvw', 'qva', 'qvo', 'qvs'
FOR Each File in filelist (Root&' \*.' &Ext)
LOAD
'$(File)' as Name,
FileSize( '$(File)' ) as Size,
FileTime( '$(File)' ) as FileTime
autogenerate 1;
NEXT File
NEXT Ext
FOR Each Dir in dirlist (Root&' \*' )
call DoDir (Dir)
NEXT Dir
ENDSUB
CALL DoDir ('C:')