Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michaelk
Contributor

Rapid directory/file scan

Hi there,

I have to scan a directory with subfolders for each day of the year, containing up to around 400 files. So this will generate more than 10000 files each month. I tried a script using the code sequence "For each ... in ... ". That works very fine, but with very low speed (several hours). Is there a more rapid way e.g. using a macro and system functions to speed up the process. The goal is, to generate a list of files with the complete path, so that I can sort out the ones, for loading the complete data from the files.

Thanks a lot

Michael

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Rapid directory/file scan

Something like this will get you a table with the full file paths:

execute cmd.exe /c dir /s /b d:\qvdata > myfilelist.txt;

LOAD @1 as Filename

FROM

myfilelist.txt

(txt, codepage is 1252, no labels, delimiter is ';');

You can use the subfield and./or index functions to get the directory and file names.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
MVP & Luminary
MVP & Luminary

Re: Rapid directory/file scan

Something like this will get you a table with the full file paths:

execute cmd.exe /c dir /s /b d:\qvdata > myfilelist.txt;

LOAD @1 as Filename

FROM

myfilelist.txt

(txt, codepage is 1252, no labels, delimiter is ';');

You can use the subfield and./or index functions to get the directory and file names.


talk is cheap, supply exceeds demand

View solution in original post

michaelk
Contributor

Re: Rapid directory/file scan

Hi Gysbert,

your idea makes the difference. It only took around 6 minutes to create a filellist with more than 900000 entries. Thanks a lot for that.

Michael