CSV Files with Column Values Containing Quotation Marks are Causing Errors
Issue
Some columns in my CSV files contain quotation marks. While syncing the files to my destination, one of the following errors appear:
Unexpected character (... (code 66)
Expected column separator character (... (code 124))
Poorly formatted file
Environment
File connectors that support CSV files.
Resolution
To resolve this issue, ensure that column values containing quotes at the beginning of the value are formatted correctly. There are two ways to format these values:
- Use two consecutive double quotes to represent each escaped double quote. If you format your column value this way, you must also wrap the entire column value in a set of double quotes.
- Escape each double quote in the column value using a backslash.
For example, the column value "New" Bus Chkg 13000
should be formatted as either """New"" Bus Chkg 13000"
or \"New\" Bus Chkg 13000
.
If the quotes are anywhere in the column value other than the beginning, our CSV parser will sync the column values as expected.