Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: 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

6 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

AndyS2
Contributor II
Contributor II

Hi ASHFAQ,

I downloaded your zip file and stored the script on my QS desktop.  I didn't see any section in the script for defining the "root" path, so I ran it anyway but it failed with the error:

No qualified path for the file: ***

at the statement:

FOR Each File in filelist (myRoot&'\*.' &Ext)

 

so I tried modifying SET myRoot = 'C:\Users\<myUserProfile>\Documents\Qlik\Sense\QDF\DEV\99.Shared_Folders\1.QVD\3.Load\revenue\dims';

but it failed with the same error

Are there some adjustments that I need to make to your "Find My Files" script?

Thanks