Docs
Browse Docs
Field guide · Text and encoding

Line breaks inside cells

A cell contains a line break, so one record can spill across several lines of the file.

What it looks like

Before
customeraddresswhat is actually there
Ana Ruiz12 Oak St[line break]Apt 4line break inside the address
Ben Cho9 Elm Avesingle line
After
customeraddresswhat is actually there
Ana Ruiz12 Oak St, Apt 4line break replaced with a comma and a space
Ben Cho9 Elm Aveunchanged
The words of the address are all still there. Only the break between them changed.

How it happens

  • Someone pressed the key combination that starts a new line within a spreadsheet cell.
  • A multi-line form field, such as an address or a comment, was exported as it was typed.
  • Text was pasted from an email or a document with its paragraph breaks.

What it breaks

  • A tool that reads the file one line at a time splits the record in two, and both halves have the wrong number of columns.
  • Row counts disagree between tools, depending on whether each one honors quoted line breaks.
  • Every column after the break shifts, so values land under the wrong headers.

How to spot it

  • Compare the number of lines in the file with the number of records it should hold.
  • Look for rows with too few columns, followed by a row that starts mid-sentence.
  • Search text columns for line break characters directly.

How to fix it

  • Read the file with a parser that respects quoted fields, so a break inside quotes stays inside its cell.
  • Replace line breaks within a cell with a visible separator such as a comma and a space, if the lines belong together.
  • If the lines are really separate facts, such as street and unit, split them into columns instead.
  • Repair a file that has already been split by rejoining the broken rows, and check the column count afterward.

TermsCSV, Delimiter, Parsing, Whitespace

Karg checks for many of these when it profiles a file, applies the fixes it is confident about, and sets the rest aside for your review. See how it works, or have our team clean your data for you.