Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys
I have a lot os csv files to upload to qlikview but some of then are delimited by comma and other are delimited by semicolon.
They are at the same directory.
How can I deal with this problem to load all of then once?
Thanks in advance.
Maybe you can load the first row of each file and determine the separator from that before loading the complete file. Something like
for each vFile in filelist('c:\Test\*.csv')
Header:
First 1
LOAD [@1:n] as Header
FROM
[$(vFile)]
(fix, codepage is 1252);
Let Sep=Left(KeepChar(Peek('Header',0),',;'),1);
LOAD * FROM
[$(vFile)]
(txt, codepage is 1252, embedded labels, delimiter is '$(Sep)', msq);
Drop Table Header;
Next vFile;
For csv use separator ,
and for semicolon use separator ;
Uder tab Delimiter options for coma,semicolon.tab,space,are available
use which one do you want and then load the files.
The problem is that in the same directory I have some csv with ';' delimiter and other csv with ',' delimiter.
My doubt is if I can choose both of then to load once in qv.
Maybe you can load the first row of each file and determine the separator from that before loading the complete file. Something like
for each vFile in filelist('c:\Test\*.csv')
Header:
First 1
LOAD [@1:n] as Header
FROM
[$(vFile)]
(fix, codepage is 1252);
Let Sep=Left(KeepChar(Peek('Header',0),',;'),1);
LOAD * FROM
[$(vFile)]
(txt, codepage is 1252, embedded labels, delimiter is '$(Sep)', msq);
Drop Table Header;
Next vFile;
It worked perfectly.
Thanks!!