Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to read file paths in a file and load data in the file path

Hi

The requirement is as below.

i need to read all the log files present in the path mentioned in a text file (path.txt)

path.txt contains data as below

D:\Job1\*.log

D:\Job2\*.log

D:\Job3\*.log

E:\Dashboard1\*.log

If it is just one path i can use For loop and read all the log files present in that particular path along with the filename() function for getting the name of the log file.

But how to do this in the above scenario (ie using the text file)

Any ideas ?

2 Replies
Gysbert_Wassenaar

Something like this:

Paths:

load @1 as Path from path.txt (txt);

For i=0 to noofrows('Paths')-1;

    let vPath = peek('Path',$(i),'Paths');

    load * from [$(vPath)] (txt);

next i


talk is cheap, supply exceeds demand
Clever_Anjos
Employee
Employee

This should work

List:

LOAD @1 as Path

from paths.txt(txt);

for i = 0 to NoOfRows('List') - 1

  LET path=peek('Path',$(i),'List');

  LOAD

  *,

  FileBaseName() as file

  from [$(path)];

next