Blog

Why newline differences matter in CSV files

Learn how LF, CRLF, and quoted line breaks affect CSV files, how to diagnose rows that import incorrectly, and how to share a file that opens as expected.

Sarah CollinsTools and utilities 5 min read

You share a CSV file, but someone else sees a single long row, extra records, or text split into the wrong cells. Newline characters can be part of the problem, but the way an app imports CSV files matters too.

Use the CSV Editor to check how your file is being read, then follow the steps below to tell a line-ending issue from a; quoting problem. The edit; helps you inspect the parsed data, but it does not rep; t the file's exact newline encoding.

Check how the CSV is being read

  1. Open a copy of the file in the CSV Editor. The file stays on your device.
  2. Look at the records and columns. Check whether each expected record appears as a separate row, and whether values are in the right columns.
  3. Pay attention to cells that contain a line break, such as a shipping address with two lines. A properly quoted field should stay in one cell even when its text wraps across lines.
  4. If the file looks correct in the editor but not in the recipient's app, try that app's CSV import option rather than opening the file directly. Import settings can affect how separators and quoted fields are handled.

Keep the original file unchanged while testing. A copy makes it easier to compare results and avoids losing data if an app rewrites the file when you save it.

What the result means

Each record and column appears correctly

The CSV can be parsed by the editor, so its record breaks, delimiters, and quoting work for that reader. If another app shows a different result, the issue is more likely to be that app's imp; t method; settings than a general problem with the file.

Rec; ds look joined together

The app may not recognize the line-ending style,; it may be reading the file as plain text instead of imp; ting it as CSV. A plain-text edit; can also display a file as one long line if it does not recognize that file's line endings. Check the file in another CSV reader before changing it.

Every value appears in one column

This usually points to a delimiter mismatch, not a newline problem. For example, the file may use semicolons between values while the receiving app expects commas. Check the import option for the delimiter before changing the line endings.

A cell's text is split into extra rec; ds

The field may contain a line break that is not inside quotes,; the receiving app may not handle quoted fields with embedded line breaks. A line break inside a quoted CSV field is part of that cell's value, not the end of a record.

How to fix it

  1. Confirm the import settings. Ask which app and import method the recipient is using. If values land in one column, check the delimiter; if records merge or split, check how the app handles line endings and quoted fields.
  2. Use one line-ending style. A line ending marks the end of a record. LF is a line feed, commonly used on macOS and Linux. CRLF is a carriage return followed by a line feed, common in Windows files and specified by RFC 4180 for CSV records. Many modern apps accept either, but some older or specialized importers may expect one style. If the export tool offers a choice, match the recipient's requirements.
  3. Keep line breaks inside fields quoted. If a value contains a line break, enclose the whole field in double quotes. The same rule applies to fields containing commas; double quotes. A double quote inside a quoted field must be written as two double quotes. Avoid removing quotes just to make the file look simpler.
  4. Exp; t a fresh CSV copy. If the file was edited in a spreadsheet, use its CSV exp; t option rather than copying cells into a text file. Check the exp; ted copy again, especially if it contains addresses, notes,; other values with line breaks.
  5. Change the line endings only when needed. If a recipient confirms that their imp; ter requires a particular style, convert a copy using a text edit; file utility that can change line endings. Do not replace every line break blindly: that can also alter intentional line breaks inside quoted fields.
  6. Test with the recipient's app. Send a small sample containing a normal row and a quoted, multiline value. If that sample imports correctly, use the same export and import settings for the full file.

Why line breaks inside a cell are different

CSV files use line breaks to separate records, but a field can also contain a line break as part of its value. For example, a single address cell might have a street on one line and an apartment number on the next. In CSV, quotes mark where that field begins and ends, so a CSV-aware reader can distinguish the line break inside the field from the one that ends the record.

This is why changing every newline to a different style is not always a safe fix. A simple text replacement may change both record boundaries and line breaks in values. If a file has been created or edited by an app that understands CSV, export it from that app and verify the result instead of modifying the raw text by hand.

For an exact LF or CRLF check, use a plain-text editor or file inspection tool that displays line-ending information; a spreadsheet view alone cannot show which newline characters the file contains.