Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the DirList/FileList expression to read the filenames from directories.
for each varFile in FileList(varDir&'\*.*')
Files:
LOAD
subfield('$(varFile)','\',-1) as FileName
AUTOGENERATE (1);
next varFile
Is it possible to get in simple way the creation/change date for the files ?
Thanks for any help !
Christian
Check out filetime:
Returns a timestamp for the date and time of the last modification of the file filename. If no filename is specified, the function will refer to the currently read table file.
filetime( 'xyz.xls' )
Will return the timestamp of the last modification of the file xyz.xls.
Load *, filetime() as X from abc.txt ;
Will return the date and time of the last modification of the file (abc.txt) as a timestamp in field X in each record read.
Check out filetime:
Returns a timestamp for the date and time of the last modification of the file filename. If no filename is specified, the function will refer to the currently read table file.
filetime( 'xyz.xls' )
Will return the timestamp of the last modification of the file xyz.xls.
Load *, filetime() as X from abc.txt ;
Will return the date and time of the last modification of the file (abc.txt) as a timestamp in field X in each record read.
Thank you.
Was not aware, that filetime([Ffilename]) works without opening the file in a load statement.
Means:
LOAD
subfield('$(varFile)','\',-1) as FileName,
filetime('$(varFile)') as FileTimeStamp
Autogenerate (1) ;
works fine and gives the last change date. Any function known for creation date?
Any function known for creation date?
Hm, I don't think there is a QV function for that. You could probably try calling system functions e.g. by use of a macro:
http://community.qlik.com/message/3597
Regards,
Stefan