Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Looping through subFolders

Good Day

i am using the following script to load  QvdTableHeader from all QVDs in Root folder QVD1

for each vFile in FileList('C:\Users\fff\rrr\WORK\TEST\QVD1'\*.qvd')

     let vFileName = mid(vFile, index(vFile, '\', -1) + 1, 99);

     LineageInfo:

     LOAD  '$(vFileName)'         as [File Name],

          Discriminator as Src,Statement

     FROM [$(vFile)] (XmlSimple, Table is [QvdTableHeader/Lineage/LineageInfo]);

next

this work fine

but bow i have developed subfolders in QVD1  and i want the above script to search as well in the Subfolders

i got he below script but failing to en-cooperate the 2 scripts

:

sub GetCSVFIleNames(Root)

    for each FoundFile in filelist( Root & '\*.qvd')

        FileList:

            Load

                '$(FoundFile)'          as [FilenameWithPath]

                 Autogenerate(1);

    next FoundFile

    for each SubDirectory in dirlist( Root & '\*' )

        call GetCSVFIleNames(SubDirectory)

    next SubDirectory

end sub

Call GetCSVFIleNames('C:\Users\fff\rrr\WORK\TEST\QVD1\') ;

please assist

0 Replies