Can Snowflake load CSV file where field contains newline?

Viewed 484

I am using COPY command to populate tables in Snowflake from file data. File format is CSV and record delimiter is \n.

This works well for the majority of data, except for a few rows where some columns contain newline characters embedded in the data.

I have tried to set my record delimiter to something like $\n but it didn't seem to work.

Is it possible to load data with embedded newlines with the CSV file format?

1 Answers

If your data may contain newline characters, the text fields should be enclosed, for example, in double quotes or single quote when generating the file. And when importing data using COPY INTO, this character must be defined in the FIELD_OPTIONALLY_ENCLOSED_BY attribute.

Reference: COPY INTO with TYPE = CSV

Related