Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Creator
Creator

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
Highlighted
Specialist II
Specialist II

Load filebasename()

from c:\myfolder\*.txt;

Highlighted
Master II
Master II

Highlighted
Partner
Partner

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);

Highlighted
Partner
Partner

Hi,

Maybe this post could be helpful for you:

Find My Files.zip

regards

Highlighted
Creator
Creator

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

Highlighted
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