Loop through Folders and sub folders to get file names

     

    Hi All,

     

    The below script gets and stored all the Qlikview filenames in folder and subfolders.

     

     

     

    Set vConcatenate = ;

    FileList:
    LOAD
    '' AS SourceFile
    AUTOGENERATE 0;

    sub ScanFolder(Root)

              for each FileExtension in 'qvw'

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

                                  FileList:
                                  LOAD '$(FoundFile)' as SourceFile
           AUTOGENERATE 1;
                                 

                                  Set vConcatenate = Concatenate;

                        next FoundFile

              next FileExtension

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

                        call ScanFolder(SubDirectory)

              next SubDirectory

    end sub


    Call ScanFolder('C:\Jagan\QV Dashboards\QV Production Dashboards') ;

     

    Hope it helps others.

     

    Regards,

    Jagan.