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

List of files in a folder

Hi there

Is it possible to generate a list ex. in a straight table of files from a folder/subfolder on the drive?
If so how can i make this list?

Thanks

/Teis

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Yes possible,

have a look at attached zip files.

Regards

ASHFAQ

View solution in original post

5 Replies
martinpohl
Partner - Master
Partner - Master

here the scipt:

for each file in filelist('C:\Temp\*.*')

first 1 load

filename() as File

from '$(file)';

next

Regards

Not applicable
Author

       sub ScanFolder(Root)

          for each FileExtension in '*'

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

                              FileList:

                              LOAD '$(FoundFile)' as Name,

                              Filesize('$(FoundFile)') as Size,

                              QvdNoOfRecords ('$(FoundFile)') as NoOfRecords,

                              Filetime('$(FoundFile)') as Time

                            

       AUTOGENERATE 1;

                            

        

                    next FoundFile

          next FileExtension

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

                    call ScanFolder(SubDirectory)

          next SubDirectory

end sub

Call ScanFolder('D:\Qlik Path Name') ;

Replace the Path in the Call function to your install - the output of this will give you a straight table using these dimensions:

Name

Time

Size

NoOfRecords

maxgro
MVP
MVP

load

  FileName(),

  1

from 'c:\temp\*.*';

ashfaq_haseeb
Champion III
Champion III

Yes possible,

have a look at attached zip files.

Regards

ASHFAQ

Andrea_Ghirardello

Try this suggestion:

How to use regular expressions

Hope this helps.

Andrea