Tabular data guides

Find a missing field or broken quote in a CSV or TSV

·

A correct table has the same number of fields in every record. An empty final field still has a position and needs its preceding separator.

CSV and TSV Validator

Repair a short record

Paste id,name on the first line, 1,Ada on the second and 2 on the third. The diagnostic identifies record 3 with one field instead of two. Add a comma after 2 to preserve the empty name and validate again.

RFC 4180 — CSV format and media type

Distinguish a quote from the end of a field

A quoted field uses two double quotes to store one literal quote. After the closing quote the parser expects a separator, a record ending or end of input. For a tab-delimited source, select Tab before interpreting any width diagnostic.

RFC 4180 — CSV format and media type

Find a missing field when a note spans two lines

Choose Comma and mark the first record as a header. The note for Ada contains a real line break inside its quotes. The next short record is the one to repair.

Three records on four physical lines
name,note
Ada,"first line
second line"
Lin
  • Append a comma after Lin to represent an empty note. The corrected table has two data records and two columns. Splitting this source at every line break would incorrectly split Ada’s record.

Common questions

Can an empty file be validated?

An empty input has no records and is rejected. A header with no data records is structurally valid.

Are extra spaces around a field discarded?

Unquoted spaces belong to the cell. A space after a closing quote is a structural error in the supported dialect.

Sources

Put it into practice.

Related guides