Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello qlikers :),
I want to get all folder names from a path and save it in a table and store it.
Please see the code what my idea is. How could I do that?
It should get all folders from the path vRoot and wirte it in a table and store it, after finishing.
SET vRoot = ['lib://Try/Folder'];
sub GetQVDFIleNames(Root)
BackupFile:
LOAD * INLINE [
ApplicationName, ID
];
for each SubDirectory in dirlist( Root & '\*' )
LOAD * INLINE [
ApplicationName, ID
];
Resident BackupFile;
next SubDirectory
end sub
Call GetQVDFIleNames($(vRoot)) ;
Thank you in advance!! Looking forward to reading some answers 🙂
sub GetQVDFIleNames(Root)
for each SubDirectory in dirlist( Root & '\*' )
let vFileName = SubField('$(SubDirectory)', '/', -1);
FileList:
Load
'$(vFileName)' as [ApplicationName],
'0' as [Backup]
Autogenerate(1);
next SubDirectory
Store FileList into $(vBackupFilePath)_NEW.csv (txt);
end sub
Call GetQVDFIleNames($(vRoot)) ;
sub GetQVDFIleNames(Root)
for each SubDirectory in dirlist( Root & '\*' )
let vFileName = SubField('$(SubDirectory)', '/', -1);
FileList:
Load
'$(vFileName)' as [ApplicationName],
'0' as [Backup]
Autogenerate(1);
next SubDirectory
Store FileList into $(vBackupFilePath)_NEW.csv (txt);
end sub
Call GetQVDFIleNames($(vRoot)) ;