Commas and quotes inside the fields of a CSV
A description such as a shop name with a comma, or an amount with a thousands comma, sits inside double quotes in a CSV export, and a double quote inside such a field is written twice. Read wrongly, one field becomes two and every column after it shifts. Choose the file below: the page works in your browser, shows the first 20 cleaned rows and lists every line it left out, with the reason.
Clean your CSV export
The cleaner detects the delimiter (comma, semicolon or tab), looks for a header row with a date column and an amount column, and writes eight fixed columns, comma-delimited: date, description, amount, currency, fee, net, reference and source. It recognises common header names in English, Spanish, German and French, such as Date, Fecha, Buchungstag, Amount, Importe, Betrag and Montant.
Your file is read in your browser and is never uploaded, stored or logged. It is held in the memory of this tab only, and closing or reloading the page discards it. Operator: Augeo. See the privacy notice.
Exports do not share one layout, and this page makes no promise about yours: the free preview shows what it does to your file.
The cleaning logic is checked by an automated test script that runs the engine file of this site over six synthetic sample files and a set of checks of the parsing rules; it ran in a sandbox before this site was published and finished with no failed check. The script does not open this page in a browser, does not test the licence key step, and nothing was tested against a real export from any provider. Use the free preview to check your own file.
Report
Warnings
Lines not parsed
Lines dropped
Preview of the cleaned rows
| line | date | description | amount | currency | fee | net | reference | source |
|---|
Download the full cleaned file
- Price: 6 USD, paid once on Gumroad. No subscription. You receive a licence key.
- What the key unlocks: the download of every cleaned row of the file you chose, as one CSV named after your file with -cleaned.csv at the end, instead of the first 20 rows on screen. The report and the way files are read stay the same.
- The key is for one buyer. Runs are not counted and no number of runs is promised. The key is kept in the memory of this page only, so you enter it again after closing or reloading the page.
- Refunds are requested through your Gumroad receipt and follow Gumroad's refund policy.
- Try the free preview first. If the preview cannot read your file, the full download cannot either.
Get a licence key on Gumroad for 6 USD
Prefer a file you keep? Offline CSV cleaner, single HTML file, 6 USD on Gumroad. The offline file was built from an earlier version of the engine, and its build self-check covered the six original sample layouts (PayPal activity, Etsy sold orders, Etsy monthly statement and three bank layouts); it does not include the later Fee/Net column reading used for the Stripe, Shopify, eBay and Square pages.
Lines from the sample files, before and after
The lines below are copied from the synthetic sample files of this site and from the cleaned files the engine wrote for them. The sample files are made up for testing and hold no real person's data.
| What it shows | Line in the sample export | Line in the cleaned file |
|---|---|---|
| A comma inside a quoted description | 08 Apr 2024,Card,"Packaging, tape and labels",£18.75,,"£7,293.50" | 2024-04-08,"Packaging, tape and labels",-18.75,GBP,,-18.75,,bank |
| Doubled quotes inside a quoted description | 03/07/2024,"POS PURCHASE ""CORNER"" HARDWARE",($45.10),,"4,772.50" | 2024-03-07,"POS PURCHASE ""CORNER"" HARDWARE",-45.10,,,-45.10,,bank |
| A thousands comma inside a quoted amount | 03/04/2024,OPENING DEPOSIT BRANCH 12,"5,000.00",,"5,000.00" | 2024-03-04,OPENING DEPOSIT BRANCH 12,5000.00,,,5000.00,,bank |
| A comma inside a quoted date and inside a quoted title | "March 20, 2024",Shipping,"Shipping label, USPS",Label #2000000001,USD,--,-$4.15,-$4.15 | 2024-03-20,"Shipping: Shipping label, USPS",0.00,USD,-4.15,-4.15,Label #2000000001,etsy_statement |
How commas and quotes inside fields are read
- A delimiter inside double quotes belongs to the field. A comma, a semicolon or a tab between an opening and a closing double quote does not start a new column, so the columns after it stay where they are.
- Two double quotes in a row inside a quoted field are one double quote. That is how a CSV file writes a quote character inside a quoted value. The value is read with a single quote character in that place.
- A double quote opens a quoted field only at the start of a field. Spaces before it are dropped. A double quote in the middle of an unquoted value, as in
12" shelf, is kept as an ordinary character. - A thousands comma inside a quoted amount is not a column break. The amount is read as one value and written as a plain decimal with a point and no thousands separator.
- The cleaned file is quoted again where it needs to be. A value that holds a comma, a double quote or a line break, or that starts or ends with a space, is written inside double quotes, with each double quote in it doubled. Values that need no quotes are written without them.
- A quote that is never closed is reported. When a quoted field is still open at the end of the file, a warning says the last record may be incomplete. Everything after the stray quote was read as one field, so look for the first row that seems wrong and at the quote before it.
- The delimiter is detected with the same reading rules, so a comma inside quotes is not counted as a column break there either.
Known limits: only the double quote is a quote character. A value wrapped in single quotes is not a quoted field, so a comma inside it does start a new column. A backslash before a double quote is not an escape; only the doubled quote is.
A line break inside a quoted field is read by the same rules. See the page about line breaks inside quoted fields.
The output is always the same eight columns (date, description, amount, currency, fee, net, reference and source), comma-delimited. A quoted field in any other column of your file is read as one value, so the columns stay aligned, but that column is not carried over. This is a cleaner for files of transactions and not a general CSV editor.
In a spreadsheet instead: import a copy of the file through the import dialog with the double quote set as the text delimiter, and look at one row that holds a comma in its description to see that the amount is still in the amount column.
Notices
- Privacy: files are read in your browser and never uploaded, stored or logged. Operator: Augeo.
- Independent tool, not affiliated with or endorsed by Etsy, PayPal, QuickBooks or any bank.
- Check the output before you use it. This is not accounting, tax or financial advice.
- Price of the full download: 6 USD one-time. The key is for one buyer. Refunds are requested through the Gumroad receipt.
- Only upload data you have the right to process. Choosing a file here does not send it anywhere, but you remain responsible for the data in it.
Other pages
- Line breaks inside quoted fields of a CSV
- Remove currency symbols and thousands separators from a CSV
- The sep= line at the top of a CSV file
- Convert a semicolon CSV to a comma CSV
- Convert a tab-delimited file to a comma CSV
- Rows in versus rows out: the count check
- Any other CSV export of transactions