Start with the expected field count
A tabular CSV usually expects the same number of fields in each record. If the header names four columns, a record with three or five fields deserves review. Count fields after parsing the quotes, not by counting every comma visible in the text.
order_id,sku,quantity,unit_price
ORD-1001,PEN-BLACK,12,1.75
ORD-1002,NOTEBOOK-A5,5The last record has three fields. If the price is intentionally blank, the four-field representation ends with a comma:
ORD-1002,NOTEBOOK-A5,5,Three common causes
An unquoted comma inside a value
MUG, BLUE becomes two fields unless it is quoted. Correct the source to "MUG, BLUE" when that text represents one value.
A missing trailing field
A short row is not automatically equivalent to a row with an empty final field. Confirm which value is missing before adding a delimiter. If the omitted value is in the middle, appending a comma can hide a shifted column instead of fixing it.
A quote that was never closed
A misplaced quote can make a parser treat subsequent physical lines as part of the same field. Inspect the first quoting error before repairing the field counts that follow it.
A careful repair workflow
- Keep the original file unchanged.
- Run the check with the known delimiter and the correct header setting.
- Locate the first affected record, then inspect the rows immediately around it.
- Identify which field should contain each value.
- Correct the export or source system where possible.
- Run a new check and compare the resulting record count and sample values.
Do not solve a ragged file by discarding every long or short row. That can remove legitimate business data. TabularGate reports the inconsistency so you can decide how it should be repaired.
Record numbers can differ from line numbers
A quoted field may contain a newline. That means one record can occupy several physical lines. Use the report's record and line references in context and inspect the quoted text around the problem.
Run the missing-field example →
Format reference: RFC 4180 documents common CSV field-count and quoting conventions. Individual applications may accept different CSV dialects.