Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kushalthakral
Creator III
Creator III

handle duplicate files while loading multiple files from a folder

Hi All

i want to load multiple files from a folder

so how i can achieve this and also handle if there are duplicate files

like i have files with name

sales_20140203

sales_20140305

sales_20140305

Thanks

Kushal Thakral

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use a wildcard in your file name, like

LOAD Field1, Field2 FROM sales_*.xls

(biff, embedded labels, table is Sheet1$);

Or use a loop, like shown in the HELP

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

LOAD

'$(File)' as Name,

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

FileTime( '$(File)' ) as FileTime

autogenerate 1;

NEXT File

I don't think you can have duplicate file names in the same directory.

View solution in original post

4 Replies
kushalthakral
Creator III
Creator III
Author

Hi All

Any one has solution for this.

Thanks

Kushal Thakral

swuehl
MVP
MVP

You can use a wildcard in your file name, like

LOAD Field1, Field2 FROM sales_*.xls

(biff, embedded labels, table is Sheet1$);

Or use a loop, like shown in the HELP

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

LOAD

'$(File)' as Name,

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

FileTime( '$(File)' ) as FileTime

autogenerate 1;

NEXT File

I don't think you can have duplicate file names in the same directory.

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try below script. Include * instead of your file date Ex: sales_*

Load FieldName1,

          FieldName2,

          ..........

From

     sales_*;

kushalthakral
Creator III
Creator III
Author

Thanks Swuehl

It helped me alot

Regards

Kushal Thakral