Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone
i have a logfile that is timestamp so what i want to do is to load the last date of this logfile i tried this
timestamp:
Load FileName() as filename,
FileSize() as filesize,
FileTime() as [Time],
Date(Floor(FileTime())) As DateField,
Time(Frac(FileTime())) AS TimeField
FROM
[Folder]
(txt, unicode, no labels, delimiter is ' ', msq) ;
it brings all the logfile name and date but what i want is to have the recent date only not others
i've attached the outcome fron the above code
thank you in advance
Perhaps this?
timestamp:
Load FileName() as filename,
FileSize() as filesize,
FileTime() as [Time],
Date(Floor(FileTime())) As DateField,
Time(Frac(FileTime())) AS TimeField
FROM
[Folder]
(txt, unicode, no labels, delimiter is ' ', msq) ;
Right Join (timestamp)
Load Max(DateField) as DateField Resident timestamp;
Hi Thabo, if you want to recover only last file maybe this code works:
For each vLastFile in FileList('C:\Test\*.txt')
NEXT
At the end of the bucle the variable vLastFile should have the value of the last file and you can use this value to load only this file.
Maybe it needs a second variable inside the If that checks if the current file in the bucle is more recent than the previous, and use this second variable to load the last log.