Fix unclosed quotes and swallowed rows

The importer failed on row 4,812 with “expected 7 fields, saw 9”, and the row looks normal. The real bug is often earlier: a quoted field that never closed. Everything after that opening quote — commas, line breaks, the next thousand records — is treated as one field until a later quote happens to appear.

Before

msisdn,location,plan
447700900458,"Leith, Edinburgh,Pay As You Go
447700900773,"Digbeth, Birmingham",Business 200GB

After

msisdn,location,plan
447700900458,"Leith, Edinburgh",Pay As You Go
447700900773,"Digbeth, Birmingham",Business 200GB

CSV Clinic looks for that pattern, including the common case where the next row’s opening quote is mistaken for a closer. It tries closing the quote so the record matches the header width, then re-parses the rest of the file. A genuine line break inside a quoted description is left intact when that reading scores better.

A stray comma and a genuine extra column look identical. If a row still has too many fields after quoting is repaired, the tool lists it instead of guessing where to merge. Those leftovers are the usual reason people want a custom fix.

Open the tool

FAQ

How do I recognise this bug before I run a tool?

If the parsed row count is far smaller than the number of lines you can see in an editor, or the error is reported at the very end of a large file, start by searching for a line with an odd number of quote characters.

Does the download re-quote fields correctly?

Yes. Fields that contain the delimiter, a quote, or a line break are wrapped, and an embedded quote is doubled, following RFC 4180.

Who runs CSV Clinic?

Short Solutions runs CSV Clinic. The repair tool on this site is free and stays in your browser. Optional paid fixes are listed on the pricing section.