Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rafatashiro
Contributor III
Contributor III

CSV delimiters

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.

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

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;

View solution in original post

5 Replies
arvind1494
Specialist
Specialist

For csv use separator ,

and for semicolon use separator ;

arvind1494
Specialist
Specialist

Uder tab Delimiter options for coma,semicolon.tab,space,are available

use which one do you want and then load the files.

rafatashiro
Contributor III
Contributor III
Author

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.

stigchel
Partner - Master
Partner - Master

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;

rafatashiro
Contributor III
Contributor III
Author

It worked perfectly.

Thanks!!