FastBankConvertFastBankConvert home

CSV Line Breaks in Cells: Why Rows Split Apart

By FastBankConvertPublished October 17, 2026

CSV line breaks in cells split a record because a CSV reader treats every line break as the end of a row, unless the cell holding it is wrapped in double quotes. A two-line description written without quotes becomes two broken rows. Quote the field to keep it in one cell, or replace the breaks with spaces before you import.

Why does a line break in a CSV cell split the row?

A line break in a CSV cell splits the row because, in a CSV file, the line break is the row separator. A reader moves through the text, splits on commas to find cells, and starts a new record at each line break. It cannot tell that one break was meant to be part of a description.

Statement PDFs produce this often. A long merchant name, or a transfer with a memo, is printed on two lines. A converter that copies the printed text faithfully writes the break into the description.

Here is an example with made-up values. The file is meant to hold one transaction:

Date,Description,Amount
2026-09-24,TRANSFER TO SAVINGS
REF 88213,-1000.00

A reader sees three lines and builds three rows. The second row has a date and half a description but no amount. The third row has "REF 88213" in the Date column and the amount in the Description column. Totals are now wrong, and sorting by date scatters the pieces.

Quoting rules that keep a multi-line CSV cell together

Quoting keeps a multi-line CSV cell together because a reader that follows the rules ignores line breaks inside a pair of double quotes. The CSV format description in RFC 4180 says fields containing line breaks, double quotes or commas should be enclosed in double quotes.

The same record, written correctly:

Date,Description,Amount
2026-09-24,"TRANSFER TO SAVINGS
REF 88213",-1000.00

That is still three physical lines, but one header and one record. The description cell holds both lines. RFC 4180 adds one more rule that matters here: a double quote inside a quoted field is written as two double quotes. A description such as 12" PIPE becomes "12"" PIPE".

If you produce CSV from code, let a CSV library write the file. Joining values with commas by hand is how unquoted breaks get in.

Tools that still split quoted line breaks in CSV cells

Some tools split a quoted line break anyway, because they read the file one line at a time before looking at quotes. Line-based command-line tools, simple import scripts, and some upload forms in older software all work this way. The file is valid; the reader is not following the format.

Signs that the reader is the problem:

  • The file opens correctly in a spreadsheet but breaks in one app.
  • Row counts from a line-counting tool are higher than the number of records.
  • The split always happens at the same descriptions.

The same trouble appears when a table moves into other text formats. A Markdown table cannot hold a raw line break inside a cell at all; turning a PDF table into Markdown covers the workaround. HTML tables handle multi-line cells fine with a <br> tag, as shown in converting a PDF table to an HTML table. If you write your own parser, extracting a table from a PDF in JavaScript shows where joined lines should be handled.

Removing line breaks from CSV cells before import

Removing line breaks from CSV cells is the safest fix when the receiving tool cannot handle quoted breaks. Replace each break inside a cell with a space, so the description stays readable and every record sits on one line.

In Excel, if the file already opened correctly:

  1. Select the description column.
  2. Open Find and Replace with Ctrl+H.
  3. In the Find box, press Ctrl+J. The box looks empty, but it now holds a line break.
  4. Type a single space in the Replace box, then choose Replace All.
  5. Save the file as CSV again.

A formula does the same job in a helper column: =TRIM(SUBSTITUTE(SUBSTITUTE(B2,CHAR(13)," "),CHAR(10)," ")). It turns both kinds of break character into spaces and trims doubled spaces.

In a text editor that supports regular expressions, be careful. A plain replace of every line break also joins the real rows. Only replace breaks that fall inside quotes, or do the job in a spreadsheet, where the cells are already separated.

The flattened example from earlier then reads:

2026-09-24,TRANSFER TO SAVINGS REF 88213,-1000.00

FastBankConvert is getting ready to open as a converter for statement PDFs that returns Excel, CSV or JSON. Get started to hear when you can test how it handles wrapped descriptions on your own files.

When to keep the line breaks in a CSV description?

Keep the line breaks in a CSV description when the break carries meaning and every tool on the path reads quoted fields correctly. An address split across lines, or a memo where the second line is a reference number, may be easier to read as printed. Spreadsheets display such a cell over several lines once you turn on Wrap Text.

Remove them when the file feeds an older import, a line-based script, or a matching rule that looks for text such as "TRANSFER TO SAVINGS REF". A break in the middle of that text stops an exact match.

All posts in CSV, JSON and text output