Quotes protect field content

A field surrounded by double quotes can contain commas or the selected delimiter without ending the cell.

Double a literal quote

Inside a quoted field, two double quotes represent one literal quote character.

Records can span lines

A newline inside an open quoted field belongs to that field; a parser must continue until the closing quote.

Validate row width

Rows with fewer or more fields than the header deserve an exact row error rather than silent padding or shifting.

Detect a dialect, then make it explicit

Comma-separated files can actually use commas, semicolons, tabs, or pipes depending on the exporting application and locale. Automatic detection compares the early rows and favors a delimiter that produces a stable multi-column shape, but a quoted sample or one-column file can remain ambiguous. Inspect the detected delimiter and column count, then select the delimiter manually if the preview does not match the source. Keep uneven-row warnings with the export instead of assuming missing cells are harmless.

Round-trip a representative sample

Before converting a large operational file, test headers, an empty value, a delimiter inside a field, a literal quote, and a quoted line break. Convert the sample to JSON and, if needed, back to CSV, then compare it in the receiving system. This parser accepts standard doubled quotes and CRLF, LF, or CR line endings, removes a leading UTF-8 byte-order mark, and deliberately rejects an unclosed quote or characters placed after a closing quote before the next delimiter.