Skip to main content

CSV structure problem

Fix Inconsistent Column Counts in a CSV

Find CSV rows with too many or too few fields, identify the structural cause, and verify the corrected file before importing it.

Use the matching tool

CSV Diagnostic

Open CSV Diagnostic

What the error actually means

A well-formed table normally has the same number of fields on every row. When one row has more or fewer, an importer may shift data into the wrong columns, reject the entire file, or silently discard values.

Likely causes

  • An unquoted comma split one address or description into two fields.
  • A closing quote is missing, causing the parser to consume the next line.
  • A trailing delimiter created an unintended empty field.
  • Rows were assembled from systems with different schemas.

Comma inside an address

Problem

42,Ada,12 Broad St, Lagos,active

Correct pattern

42,Ada,"12 Broad St, Lagos",active

A safe repair workflow

  1. 1Run the diagnostic and note the expected column count.
  2. 2Filter the report to mismatched rows and inspect the first failure.
  3. 3Correct the source-system export when possible; otherwise repair quoting or remove unintended separators.
  4. 4Run the diagnostic again on the corrected copy before importing it.

How to verify the result

A file that downloads successfully is not automatically a correct file. Check the result at both the structural and business-data levels:

  • Every data row matches the header width.
  • Empty values remain explicit rather than shifting later fields.
  • The first and last records are present.
  • A spot check confirms values are under the correct headers.

Read the deeper guides