Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading timestamps

Hi,

Is it possible to load only the timestamps of all the files present in a folder without loading it's data?

1 Solution

Accepted Solutions
MarcoWedel

LOAD DISTINCT

           Filename() as Filename,

           Filetime() as Filetime

FROM path\*.*;

View solution in original post

12 Replies
anbu1984
Master III
Master III

Do you mean timestamp in filenames?

Not applicable
Author

Hi Asma,

Below VB Script may be of help.

Function ShowFileAccessInfo(filespec)

  Dim fso, a, s

  Set fso = CreateObject("Scripting.FileSystemObject")

  Set a = fso.GetFile(filename)

  msgbox  f.DateLastModified

End Function

You can use this in macro and trigger as per requirement. Small change is required e.g. giving path of the file and so.

Thanks & Regards

Suhas Gupta

Not applicable
Author

Yes timestamp of a file

varunjain
Creator
Creator

Is the timestamp  appended with the Filename?

anbu1984
Master III
Master III

You can use appropriate function to retrieve timestamp from filenames. What is the format of filenames?

LOAD SubField(FileName(),'_',2) As Ts

FROM

(ooxml, embedded labels, table is Sheet1) Where RecNo() < 2 ;

Not applicable
Author

No, the file timestamp is not appended to the file name.

anbu1984
Master III
Master III

Then which file timestamp you need? Last modification timestamp?

Anonymous
Not applicable
Author

Try something like this

LET vPath = Replace (DocumentPath (), '\' & DocumentName (), '')&'\QVDs';

trace $(vPath);

FOR Each File in filelist ('$(vPath)\*.*')

  trace $(File);

  fileTable:

  LOAD '$(File)' as Name,

  FileSize( '$(File)' ) as Size,

  FileTime( '$(File)' ) as FileTime

  autogenerate 1;

  TRACE folderpath-- $(vPath) . filename-- $(File);

NEXT File

Which was pasted from this thread

http://community.qlik.com/message/649037#649037

Not applicable
Author

I have used filetime() function to get the filestamps of all the files present in the folder. But the problem is while loading the timestamp of all the files, it also loads the data present in those files. In the script execution box, i am able to see the number of lines fetched. How can i load timestamp without loading all the rows