CSV Guide

Quoted fields and broken CSV quotes

Quotes protect commas and line breaks inside field values. One missing or stray quote can change how the rest of the file is parsed.

Why CSV needs quotes

A delimiter separates fields, so a value that contains the delimiter needs protection. Double quotes are the usual CSV mechanism. The same applies when a field contains a line break.

Valid comma inside a field

sku,title,price
A1,"Shirt, Blue",19.99

The title is one field even though it contains a comma.

Valid quote inside a quoted field

A2,"12"" Display",249.00

A literal double quote inside a quoted field is represented by two double quotes. This is easy to break when data is edited manually or passed through software that changes quote characters.

Multiline fields are legal

A3,"First line
Second line",10.00

A line break inside a quoted field does not end the record. A parser must maintain quote state while reading multiple physical lines.

Missing closing quote

A4,"Broken title,12.00
A5,Next product,15.00

The parser may treat the second physical line as part of the first field because the quote never closed. This is why a single error can produce a surprising row count or a cascade of column mismatches.

Stray quote

A6,Blue 12" Shirt,19.99

Whether this is valid depends on the parser and quoting rules. If the field is not quoted correctly, the quote can trigger an import error. A repair tool should show the row and context instead of deleting every quote automatically.

Curly quotes are different characters

Typography tools can replace straight ASCII quotes with curly opening and closing quotation marks. A destination may treat these as ordinary text instead of CSV delimiters. This is especially relevant to Shopify’s “illegal quoting” troubleshooting.

Why automatic quote repair is dangerous

If the tool cannot prove where a quote was intended, inserting or deleting one can change field boundaries and therefore change the meaning of the data. CSVFixLab reports ambiguous quote problems and disables automatic repair when re-serialization is unsafe.

A practical debugging sequence

  1. Confirm the delimiter.
  2. Locate the first row where quote state becomes invalid.
  3. Inspect the row before and after that location.
  4. Compare the expected field count with the parsed field count.
  5. Correct the smallest possible portion of the source data.
  6. Re-run the structural check before importing.
Find the row: Use the Broken Quote Checker.