Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
random_user_3869
Partner - Creator III
Partner - Creator III

loading multiple csv files issue

Hello i do the following statement,

for each vs_file in FileList('$(vL.DirectoryPath)*.csv')
Temp_Table:
LOAD
*
FROM [$(vs_file)]
(txt, utf8, embedded labels, delimiter is ',', msq, header is 11 lines);


next vs_file

I have a script error saying that the file has not been found.

anyone can help ?

Thanks

 

Labels (1)
11 Replies
edwin
Master II
Master II

you should use the convention for the folder data connector.  what i do is use the folder connector, add a script for just one of the CSV files so you can see the syntax for the data connection.  replace the folder name inside the data connection.

then use that convention in your for each code

random_user_3869
Partner - Creator III
Partner - Creator III
Author

I don't understand what you mean by "use the convention for the folder data connector".

the vL.DirectoryPath  = 'lib:.....' so the path i previously use without the variabel to get to the folder.

Sorry my english is not à 100% efficient.

Thank you for your feedback

edwin
Master II
Master II

we do a lot of guess work here.  maybe check the full result f this:

$(vL.DirectoryPath)*.csv

thats my only suggestion

edwin
Master II
Master II

also per may prior suggestion using the wizrd, add one of the CSV file in your script and then compare with the result of your expression:

$(vL.DirectoryPath)*.csv

edwin
Master II
Master II

perhaps you are missing a slash or backslash

 

vinieme12
Champion III
Champion III

please post a screenshot of the message 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
random_user_3869
Partner - Creator III
Partner - Creator III
Author

Hello,

 

The message is in french

 

lessassy_3869_0-1652431520482.png

 

basically it says that the file is not found.

it's like it doesnt't recognize the '*' caracter.

To add more information

 

at the end of my loop i have the following

 

FROM [$(vs_file)]
(txt, utf8, embedded labels, delimiter is ',', msq, header is 11 lines);

next vs_file

 

Thank you

vinieme12
Champion III
Champion III

if you just want to load all csv files in a folder you don't need to loop thru each of them

 

Temp_Table:

Load *

From '$(vL.DirectoryPath)'&'*.csv'

(txt, utf8, embedded labels, delimiter is ',', msq, header is 11 lines);

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
random_user_3869
Partner - Creator III
Partner - Creator III
Author

Hello everyone,

sorry i forgot to say that i load the file from a document in a sharepoint folder (connection is working fine)

and i'm using qlik saas:

 

so basically when i do that it works:

LOAD
Attended,
"User Name (Original Name)",
"First Name",
"Last Name",
Email,
"Country/Region",
Organization,
"Registration Time",
"Approval Status",
"Join Time",
"Leave Time",
"Time in Session (minutes)",
"Type of organisation",
"Which maritime sector are you most interested in?",
Other?,
"Country/Region Name",
"Source Name"
FROM [lib://CMEMS Marketing - Développement:COMPANY SHAREPOINT/Documents partages/qlik/MODataConnexions/cmems/accounting/EventFiles/Zoom-MarineData4Europa_Workshop2-08122019.csv]
(txt, utf8, embedded labels, delimiter is ',', msq, header is 11 lines);

but when i do this 

 

LOAD
*
FROM [lib://CMEMS Marketing - Développement:COMPANY SHAREPOINT/Documents partages/qlik/MODataConnexions/cmems/accounting/EventFiles/Zoom-MarineData4Europa_*.csv]
(txt, utf8, embedded labels, delimiter is ',', msq, header is 11 lines);

 

it doesn't work anymore.

Is '*' caracter not working iin qlik saas anymore ?

thanks