Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load all files in folder with two extension types

Hi guys,

I want to load all files within a folder (in which has sub folders, which I DON'T want to load).

At the moment I'm using  [pathname\*.xls] which reads XLS files, but I ALSO want to load in xlsX files.

Is there a way to do this?

Thanks!

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try This

LET PathName = '..\..\MyDirectory\*.xls?';

Not applicable
Author

Hi,

and if you may have there xlsY, which maybe you dont like to load, you may try something presented in help:

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:')

jerrysvensson
Partner - Specialist II
Partner - Specialist II

You need to load these files separately since the load structure is different for xls and xlsx.

Like :

TempXls:

pathname\*.xls]

TempXlsx:

pathname\*.xlsx]

And then do a concatenate.