Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

List all file names in a directory

Is it possible to have QlikView search a directory (C:\myfolder) and return list of all the file names in that folder? All of the files are .txt files.

Thanks,

1 Solution

Accepted Solutions
mwscott1
Creator
Creator
Author

Thanks for all the replies. I was able to get it to work found this script

set vRoot = 'C:\myfolder';

FOR Each Ext in 'txt'

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

Load '$(File)' as Name, FileSize( '$(File)' ) as

Size, FileTime( '$(File)' ) as FileTime

autogenerate 1;

next File

next Ext

View solution in original post

6 Replies
preminqlik
Specialist II
Specialist II

Load filebasename()

from c:\myfolder\*.txt;

m_woolf
Master II
Master II

martynlloyd
Partner - Creator III
Partner - Creator III

I use this in my script:


// ================ Get TXTfiles ==========================
SUB DoDir (Root)
LET vFirstLoop=1;
Let FileMask= Root &'\*.txt;

FOR Each File in filelist (FileMask);
 
  FileList:
  LOAD
  '$(File)' as Name,
  FileSize( '$(File)' ) as Size,
  FileTime( '$(File)' ) as FileTime
  autogenerate 1;

NEXT File

ENDSUB
// ====================================================

CALL DoDir (MyPath);

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

Maybe this post could be helpful for you:

Find My Files.zip

regards

mwscott1
Creator
Creator
Author

Thanks for all the replies. I was able to get it to work found this script

set vRoot = 'C:\myfolder';

FOR Each Ext in 'txt'

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

Load '$(File)' as Name, FileSize( '$(File)' ) as

Size, FileTime( '$(File)' ) as FileTime

autogenerate 1;

next File

next Ext

vireshkolagimat
Creator III
Creator III

Hi, is there any way to specify multiple file extension.

if i have excel and text file in the same folder, how we will load it.

and also how to load the files which are available in sub folder.

thanks