Copy CSV file into Snowflake, The data itself has commas

I am loading data into a file through copy into command in snowflake. it is a CSV file and one of the column contain "," (comma) with in the data itself. How do we load such data into the table. Any ideas, please revert

Keshava

posted on 16 Aug 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds




nVector18-Aug-19

Can you try enclosing the data in double quotes in the file? For example:

id,text1,text2
1,"1,2,3","cat"

and while running the copy command, use a file format like below,

// Create file format
create or replace file format CSV_SKIP_HEADER
type = 'CSV'
field_delimiter = ','
FIELD_OPTIONALLY_ENCLOSED_BY = '"'
skip_header = 1;