Keep 001 and commas intact in CSV: check quotes and line breaks
One example tests a product code with leading zeros, a note containing a comma, and a multiline cell. It also shows why splitting on every comma or line break can misread CSV.
A visible line is not always a data row
This CSV contains one header row and two data rows. The actual line break between Two and lines belongs to one cell because it is inside quotes. The comma in A, B is also part of the note, not a field separator.
What the site reads
The parser used by our CSV β Excel tool returns three rows including the header, with two cells per row. It preserves 001 and 002 as strings, the comma in A, B, and the line break after Two. The result below is shown as a JSON array to make the cell boundaries clear. The visible \n represents a line break within a cell.
When a closing quote is missing
The final example leaves the noteβs opening quote unclosed. Instead of returning a successful result, the parser throws the error shown below. Add the closing quote to the source and try again. A literal quote inside a quoted field must be doubled. Do not treat this parser as a complete validator for every possible CSV error.
Moving the file to another program
CSV does not include a data type declaring that a column contains product codes. Even though this parser preserves 001, another program may interpret it as a number and remove the leading zeros. Set the code column to text when importing, then reopen the saved result to check the codes and multiline notes.
Try the example yourself
Paste the CSV below into the CSV β Excel tool and check the codes and notes in the table. Start with the valid example, then compare it with the version missing a closing quote. This article verifies parser cell values and the unclosed-quote error; it does not test import behavior in every spreadsheet application.
Input CSV: include the line break inside the note
code,note
001,"A, B"
002,"Two
lines"The test uses CRLF between rows and LF inside the quoted field. Both appear as line breaks on this page.
Cell values read by the actual parser (shown as JSON)
[
[
"code",
"note"
],
[
"001",
"A, B"
],
[
"002",
"Two\nlines"
]
]Input with a missing closing quote
code,note
001,"A, BError returned by the parser
Invalid CSV: unclosed quote