Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
umartareen
Creator II
Creator II

Loading Filetime from all Subfolders of a root folder

Hi,

I want to load the filetimes of files present in all the subfolders of that particular root folder.

My script is as follows :

LET vPath = 'J:\IT\Time';

LET vType = '*';

for Each Filename in FileList('$(vPath)\*.$(vType)')

LOAD Distinct

          FileTime() as [File -Time],

From [$(Filename)];

NEXT Filename;

This script extracts filetime of only those files present in the path defined and not from its subfolders. I want the data from all its subfolders as well, how is this achievable ?

Thanks,

Umar

1 Reply
m_woolf
Master II
Master II

This is from QV Help:

Let Root = 'Your folder path';

// list all QV related files on disk

SUB DoDir (Root)

FOR Each Ext in 'qvw', 'qva', 'qvo', 'qvs'

FOR Each File in filelist (Root&' \*.' &Ext)

LOAD

'$(File)' as Name,

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

FileTime( '$(File)' ) as FileTime

autogenerate 1;

NEXT File

NEXT Ext

FOR Each Dir in dirlist (Root&' \*' )

call DoDir (Dir)

NEXT Dir

ENDSUB

CALL DoDir ('C:')