Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
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
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