Blog

Quoted commas breaking CSV fields? Fix a supplier catalog

See why commas inside quoted supplier descriptions split CSV columns, how to inspect the affected rows, and how to correct quotes without damaging catalog data.

Sarah CollinsTools and utilities 4 min read

A supplier catalog opens with product descriptions split across extra columns, or prices appear under the wrong headings. A comma inside a description can be valid CSV, but only when the field is quoted correctly. A missing or misplaced quote can make the rest of a row shift.

Use the CSV Editor to inspect the affected rows and edit the file in your browser. First make a copy of the original so you can compare the data and undo a mistake.

Inspect the supplier catalog

  1. Open the CSV Editor and load a copy of the catalog file.
  2. Look at the header row and a few unaffected product rows. Note how many columns each should have, such as SKU, description, quantity, and price.
  3. Find a row where the description contains a comma. Check whether the words and values still appear under the expected columns.
  4. Compare the same row with nearby records. Look for an extra column, a missing value, or later rows that appear to have been pulled into the description.

For example, A104," Valve, brass, 1/2 inch" ,12.50 has three fields: the SKU, the description, and the price. The commas inside the quoted description are part of that one field, not separators between columns.

What the result means

The description stays in one column

The commas are being handled correctly. In CSV, double quotes around a field allow it to contain commas without splitting into separate fields. If another program still shows extra columns, its import settings may be treating quotes as ordinary characters rather than as the text qualifier.

Fields shift after the description

Check the quote marks around that description. A missing closing quote, or a quote in the wrong place, can cause a parser to treat commas that follow as part of the field. The row may then have too few or too many columns.

A description contains a quotation mark

A quote that is part of the actual text must be doubled inside a quoted field. For example, " Pipe " " Pro" " coupling, 2 inch" represents the description Pipe " Pro" coupling, 2 inch. A single undoubled quote inside the value can confuse a CSV reader.

Only one program displays the problem

The file may be valid while the other program is importing it with the wrong; quote character. The; the character that separates fields. Check that the import expects a comma as the; a double quote as the text qualifier. Some catalogs use a different delimiter, such as a semicolon, so compare the raw file with a known-good row before changing anything.

How to fix it

  1. Keep an untouched backup. Make a duplicate of the supplier file; work on that copy. This gives you a safe comparison if a correction changes more rows than intended.
  2. Find the first broken row. Compare its number of fields with the header; with a normal row. Start at the earliest row where the columns shift, because a quote left open there can affect how later content is read.
  3. Pair the quotes around comma-containing text. If a description has commas, enclose the whole field in double quotes, for example "Valve, brass, 1/2 inch". Do not remove its commas just to force the row into the expected number of columns.
  4. Double quotes that belong in the description. Inside a quoted field, represent a literal quote with two quote marks. Change "Pipe "Pro" coupling" to "Pipe ""Pro"" coupling".
  5. Edit only the affected values. Use the CSV Editor to correct the broken field, then check the complete row again. Avoid replacing every comma in the file or adding quotes around every value without checking the format. Those broad changes can damage valid fields.
  6. Reopen; verify the corrected copy. Load the saved file again; check the edited row, the next few rows,; the total column pattern. If you are importing it into another program, set that program to use the catalog's actual delimiter and double quotes as the text qualifier.

If the file contains a line break inside a quoted description, that can be valid too. Do not assume every line break marks a new product row. Check whether the text is still inside a properly quoted field before removing line breaks.

Why a comma can be both data and a separator

CSV uses a delimiter to divide fields, but quoted text can contain that same character. A reader needs the quote marks to know where the description begins and ends. In a well-formed row, the quotes surround the whole field, and any quote that is part of the text is written twice.

A comma inside a quoted description is not itself an error. The problem is usually an unmatched quote, a literal quote that was not doubled, or an import setting that does not recognize the quote character. Before editing, confirm which case you have. For related steps on editing and saving a corrected file, see how to correct a CSV and save the edited file.

The CSV Editor runs in your browser, and files you open stay on your device.