Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

REST SQL Select from CSV failed because symbols in csv file

Hi all. 
I tried to load csv data using Rest connector.

TabName:
SQL SELECT
field 1,
field 2
FROM CSV (header on, delimiter ",", quote """") "CSV_source"
WITH CONNECTION (
URL = "some url");



And for one file I received error message:

Unexpected symbol ' '(#32) at (line 2908, col 27). Delimiter ',' or EOL is expectd.


This happens because some fields in csv looks likr this : SPÓ£KA Z O.O., PUÑSK

Is there any ways to upload data with such charters? 

Labels (1)
1 Solution

Accepted Solutions
Peony
Creator III
Creator III
Author

The issue appeared easier than i thought. I should replased

 quote """"

with

 quote "''"

 and upload become successful

 

View solution in original post

4 Replies
vincent_ardiet_
Specialist
Specialist

Maybe you can try to read row by row first with some Replace (or MapSubstring) to clean the data and then process to a decomposition using SubField to create your 2 fields.

Peony
Creator III
Creator III
Author

Thank you for your idea @vincent_ardiet_  Unfortunately as I see, I can't use Qlik functions inside SQL select.

vincent_ardiet_
Specialist
Specialist

Something like this (i have picked £ as a delimiter but you have to be sure that it is not present in your data).
But by the way, maybe just the "no quotes" could help you to retrieve correct data...

TabName:
Select 
subfield(fullrow,',',1) as field 1,
subfield(fullrow,',',2) as field 2;
Select Replace(fullrow,chr(34),'somethingelse') as fullrow;
SQL SELECT
fullrow
FROM CSV (header on, delimiter "£", no quotes) "CSV_source"
WITH CONNECTION (
URL = "some url");

 

Peony
Creator III
Creator III
Author

The issue appeared easier than i thought. I should replased

 quote """"

with

 quote "''"

 and upload become successful