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

Problem in Loading Data from Sub-directories

Anyone please help me in with below QV Code, I am not able to load files from Sub-directories..

set Concatenate=; 

sub ScanFolder(Root)
for each Ext in '.xls' // use this to identify file names to load but I can't use the wildcard to pull all File1*
for each FoundFile in filelist(Root & '\*.' & xls)
FileList: 
$(Concatenate)
load *
from
[$(FoundFile)](biff, embedded labels, header is 2 lines, table is [$(*)]); // my load has different parameters depending on the file name.

set Concatenate = concatenate;
next FoundFile
next Ext

for each SubDirectory in dirlist(Root&'\*')
call ScanFolder(SubDirectory)
next SubDirectory
end Sub

Call ScanFolder('D:\Data\Inputs');

1 Reply
Anonymous
Not applicable
Author

Hi Narsingh,

Please refer to this thread Loop through root directory (including subfolders) and list filenames of *.csv, maybe this solution can be helpful for you.

Regards,

Karla