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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weird issue with filelist function + wildcard + CSV files

Hi !

I am using the filelist() function along with a "for each" in order to load several CSV files. I am using QV 11.20.

This particular piece of code :

For each vFile in FileList('.\*.csv')

trace file : $(vFile);

sleep 2000;

Next vFile

leads to load *.csv file which is the expected behavior, but it also loads *.csv*. It means it loads also *.csv_old for example.

I tried also with xlsx files, but it behaves correctly in that case. This seems specific to CSV files.

Is there any mean to disable this strange behavior ?

Thanks,

Laurent

4 Replies
marcus_sommer

It looks like a bug .... You could as workaround check the extension directly or the len(extension) in an additionally step like:

if subfield('$(vFile)', '.', -1) = 'csv' then

...

end if

- Marcus

Not applicable
Author

Thanks Marcus.

Actually, we used a similar code to bypass this bug :

if('$(vFile)' like '*.csv') then

...

end if

Laurent

pljsoftware
Creator III
Creator III

Hi Laurent,

this is a bug, reports to Qlikview.

Thanks for your note.

Luca Jonathan Panetta

Anonymous
Not applicable
Author

Yes. It's a bug.

Test the filename extension individually inside loop.

Caria