Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik folks,
I'd like to improve my code and there is a summary of my goal :
In the more generic way possible, I'd like to implement in all my apps a way to check files integrity.
My QVDs are in various folders and various paths
Thanks to the community, I've found help from previous posts to create a function that loop on every folders next to the path.
The files I'd like to check are similar to :
My actual code can only loop on a single root (single server) here it is :
Sub FindFiles (Root)
For Each File In FileList(Root&'/*')
SET vFile = '$(File)';
QVD_Files:
First 1
Load
'$(File)' as FileName,
Subfield('$(File)','/',-1) as QVDName,
FileTime( '$(File)' ) as QVDFileTime,
floor(FileTime( '$(File)' )) as FileTimeNum,
FileSize('$(File)') as FileSize,
QvdNoOfRecords('$(File)') as FileEntries
AutoGenerate 1 ;
Next File
End Sub
/// Call FindFiles ('lib://SERVER1/QVD_Files/');
/// stuff, check, drop
What would you do to make this generic and able to loop on several folders from different servers (root) ?
Thanks, a lot, for your kind help 🤗
I think I would just duplicate the Call statement for each directory of interest.
-Rob