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

load all files in a folder

Hi and sorry for posting this question.
I'm trying to load multiple csv files from a amazon storage and I can't get the '*' to work.. and I can't understand why.

 

This work for a single file (but I want everything in the folder )

Shipping_EU:
Load
@1 as date

From [lib://2. Transform:Amazon_S3/qlik/import/UPS/.EU/202011061114.csv](txt, no labels, delimiter is ',');

 

I'm trying to use the * wildcard for the file name but this gives me an "Cannot open file: 'lib://2. Transform:Amazon_S3/qlik/import/UPS/.EU/*.csv' (Connector error: File not found)"

Shipping_EU:
Load
@1 as date

From [lib://2. Transform:Amazon_S3/qlik/import/UPS/.EU/*.csv](txt, no labels, delimiter is ',');

 

I have also tried looping 

For each File in Filelist(vPath) Load * From [$File]

But that gives me the same result, when I specify by name it works but as soon as I want to include * instead of the file name nothing can be found. 

Thanks

David

1 Solution

Accepted Solutions
tm_burgers
Creator III
Creator III

For Amazon S3 the syntax is:

LIB CONNECT TO 'Amazon_S3_Metadata';

tmpFiles:
LOAD
Key
    ;
SELECT
Key
FROM List
WITH PROPERTIES (
dir='SubFolder',
maxResults=''
);

for i = 0 to NoOfRows('tmpFiles') -1
  let vFile = peek('Key', i, 'tmpFiles');
   
    LOAD
        *,
        filename() as FileName
    FROM [lib://Amazon_S3/$(vFile)] (txt, no labels, delimiter is ',');
next

 

 

https://community.qlik.com/t5/Qlik-Connectors-Discussions/Wildcard-Load-in-Dropbox-for-Qlik-Sense-Bu...

View solution in original post

1 Reply
tm_burgers
Creator III
Creator III

For Amazon S3 the syntax is:

LIB CONNECT TO 'Amazon_S3_Metadata';

tmpFiles:
LOAD
Key
    ;
SELECT
Key
FROM List
WITH PROPERTIES (
dir='SubFolder',
maxResults=''
);

for i = 0 to NoOfRows('tmpFiles') -1
  let vFile = peek('Key', i, 'tmpFiles');
   
    LOAD
        *,
        filename() as FileName
    FROM [lib://Amazon_S3/$(vFile)] (txt, no labels, delimiter is ',');
next

 

 

https://community.qlik.com/t5/Qlik-Connectors-Discussions/Wildcard-Load-in-Dropbox-for-Qlik-Sense-Bu...