What “expected 10 columns, found 9” really means
A CSV parser does not see spreadsheet cells. It reads delimiters and quoting rules. If the header resolves to 10 fields and a later row resolves to 9 or 11, something about that row changed the parser’s interpretation.
Common cause 1: a missing delimiter
sku,title,price
A1,Blue Shirt19.99If a separator is missing between two values, the row has fewer fields than expected.
Common cause 2: an extra unquoted delimiter
A2,Shirt, Blue,24.99If Shirt, Blue was intended as one title, it needs quoting. Without quotes, the comma creates an extra field.
Common cause 3: a broken quote earlier in the row
A missing or stray quote can change where the parser recognizes delimiters. Column mismatch errors are therefore often a symptom rather than the root cause.
Common cause 4: a multiline value was exported incorrectly
Line breaks inside a quoted field are legal. A line break inside an unquoted field ends the record, which can create one short row followed by another malformed row.
Why row numbers can differ between tools
Some parsers count physical lines while others count logical CSV records. Multiline quoted fields make those numbers different. A useful diagnostic report should make it clear whether it is showing a physical line or parsed record.
How to debug safely
- Use the header to establish the expected field count.
- Find the first mismatched record.
- Inspect the raw text around that record.
- Check quote balance and delimiter placement.
- Fix only the local structural error.
- Re-parse the entire file, because one quote error can affect later rows.
Do not pad rows with empty fields automatically
Adding commas until every row has the same count can hide real data loss. If a row is missing a value in the middle, the tool cannot know which field is missing. Padding is safe only when the destination schema and the missing position are unambiguous.