CSV / record-boundary guide

Diagnose CSV column shifts from quotes and newlines

A comma inside quotes and a newline inside a quoted field are still one cell. Only a row whose field count is wrong after quote parsing is malformed. Separate those cases before changing data.

Do not decide by counting commas

ExampleCorrect interpretationCheck
"山田,太郎"One cell containing a commaWhere quotes close
"line 1
line 2"
One cell containing a newlineNewline is inside quotes
001,山田Too few fields if 3 are expectedField count per row

A CSV record boundary is verified after quotes are interpreted.

Reproduce it with fixtures

quoted.csv is a valid case with a quoted comma and newline. ragged.csv is a negative case with a missing field. The valid case has 2 rows, 3 columns, and a two-line note cell.

id,name,note
001,"山田,太郎","line 1
line 2"
002,"佐藤花子","single line"

Do not guess a missing value in the negative case; confirm it with the source.

Verify and hand off with Web-Tool

  1. Keep the original CSV and create a working copy.
  2. Open Table to Excel and verify quoted commas and newlines stay in one cell.
  3. Check rows, columns, headers and multiline cells before exporting.
  4. Give the recipient the verification result and the basis for any repair.

This guide and Table to Excel work in the browser. Source files and input are not sent to an external server.

Do not repair by guesswork

If quotes are cut off, a newline is unclosed, or a row has too few fields, do not fill the value from appearance alone. Confirm the original and sender first.