Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (3)
4 Replies

Re: Weird issue with filelist function + wildcard + CSV files

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

Re: Weird issue with filelist function + wildcard + CSV files

Thanks Marcus.

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

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

...

end if

Laurent

pljsoftware
Contributor III

Re: Weird issue with filelist function + wildcard + CSV files

Hi Laurent,

this is a bug, reports to Qlikview.

Thanks for your note.

Luca Jonathan Panetta

bestofwest
Contributor II

Re: Weird issue with filelist function + wildcard + CSV files

Yes. It's a bug.

Test the filename extension individually inside loop.

Caria

Community Browser