Sorry, but I'm not understanding it quite yet. You have a number of directories, each of which holds a file named log.txt. The log files are created per date, so the number of directories will grow in time. You want to load each log.txt in qlikview. So you need a script that dynamically finds all the log.txt files and loads them. That's possible. Have you already achieved this?
I assume the contents of the log files will have the same format, i.e same number of columns (or maybe just a line of text that can be split into columns). Is that correct?
Next, you're talking about storing. What do you want to do? Load each log.txt and then store it as a qvd or excel file? Or do you want to store other information. Can you give some more details on what you want to do with the data once you've loaded it into qlikview?
Yes the all the log files have same format and not the content.
I have dynamically loaded all the log files and loaded into Qlikview.
My need is to find from which log file the data are loaded.
Like for each date the data loaded would be different so once it load into Qlikview, will have all the informations in a single table. In tat I need to identify from which log.txt file the data is loaded, it is from 20120930\log.txt or 20121001\log.txt file and so on.
if rowno()=1 checks if we are on the first record. If we are then we use Time to use as StartTime. If we are not on the first row we peek to the previous record and get StartTime. That way for all records StartTime will be the same as Time of the first record.
The second if statement you can ignore. That won't work. My brain tripped me .
I doubt you can do it in one pass. If you loop twice through the files you can do something like
filepath() as logdir,
min(Time) as Startime,
max(Time) as Endtime
and later join StartEndTimes with the table with the logdata on logdir