Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to loop through a folder and get the file name and update date. I would like to create a dashboard that shows the last time a file (qvd) was updated.
Can anyone point me in the right direction?
thanks
Use below as a baseline.
set vRoot = '.';
FOR Each File in filelist ('$(vRoot)'&'\*.qvd')
CurrentFileList:
Load
'$(File)' as File
,FileTime( '$(File)') as LastUpdate
autogenerate 1;
next File
it loops through all qvds in a folder (vroot) and created table with file name-path and last update datetime
Use below as a baseline.
set vRoot = '.';
FOR Each File in filelist ('$(vRoot)'&'\*.qvd')
CurrentFileList:
Load
'$(File)' as File
,FileTime( '$(File)') as LastUpdate
autogenerate 1;
next File
it loops through all qvds in a folder (vroot) and created table with file name-path and last update datetime
@FrankC you can customize the below code :
Set $v_File_root = FileTime('C:...'); // your folder path
Set vConcatenate = ;
sub ScanFolder(Root)
for each FoundFile in filelist( Root & '\*.*');
FileList:
$(vConcatenate)
LOAD *,
FileTime('$(FoundFile)') as XX,
FilePath('$(FoundFile)') as YY,
'$(Root)' as ZZ
FROM [$(FoundFile)] (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
Set vConcatenate = Concatenate;
next FoundFile
for each SubDirectory in dirlist( Root & '\*' )
call ScanFolder(SubDirectory)
next SubDirectory
end sub
Call ScanFolder('C:\.....') ;
you need FileTime() for the update information ....