To import a CSV with line breaks inside a field without splitting its record across Excel rows, use Data > From Text/CSV in Excel for Microsoft 365 on Windows, check the preview, and load the data. The file must put quotation marks around any field containing a line break; if the break is unquoted, Excel will usually treat it as the start of a new row.
Import the CSV using Excel’s data importer
For a dependable import, open a blank workbook and use Excel’s importer rather than relying on a double-click. On Windows, select Data > From Text/CSV, choose the file, and inspect the preview. Confirm that the delimiter is correct—typically a comma—and that each record appears on one preview row, even when a field contains a line break. Select Load to bring the data into the workbook, or choose Transform Data first if you want to review or adjust it in Power Query.
- Keep the CSV file unchanged and open the destination workbook.
- Choose Data > From Text/CSV and select the CSV.
- Check the delimiter, text encoding or file origin, and previewed columns.
- Confirm that multiline fields stay within their records. If the preview shows a record split into separate rows, stop and check the CSV format before loading.
- Choose Load, or use Transform Data to inspect and clean the contents first.
In the preview, a newline may be displayed as a visible line break within a cell or as wrapped text, depending on the importer’s view. The key check is that the next record has not shifted into a separate row and that the columns still line up. After loading, select a cell containing the text and look in the formula bar to confirm that both parts are present.
Why a line break can be part of a CSV field
A CSV file is plain text arranged as records and fields. A line break usually marks the end of a record, but CSV conventions also allow a field to contain a line break when that field is enclosed in double quotation marks. Excel’s importer can then treat the enclosed lines as one field instead of separate records.
For example, this CSV has two records, not three:
ID,Comment
17,"First line
second line"
18,"No break"
The first comment contains an intentional newline. Because the whole field is quoted, a CSV-aware importer can keep both lines in the same cell on the row for ID 17. The visual appearance of the source file can be confusing: a text editor may show the comment on two lines, even though it is one field in one logical record.
This is different from a line break that separates records. If the same field were written without quotation marks, the importer could interpret the second line as a new record. It cannot reliably guess whether an unquoted newline was intended as text or as a row boundary.
How CSV quoting handles newlines and commas
Quotation marks group a field that contains characters that could otherwise be mistaken for CSV structure. A field generally needs quotes when it contains the delimiter, a quotation mark, or a line break. Inside a quoted field, a literal quotation mark is commonly represented by two quotation marks. For instance, a comment containing the words He said "hello" can be represented as "He said ""hello""".
Excel can preserve line breaks when saving or exporting CSV by quoting affected fields. However, CSV files are not all produced consistently: a system may use a different delimiter, encoding, or line-ending convention, or may create malformed quoting. The file extension alone does not guarantee that every row follows the same rules. If a supplier’s file does not quote a multiline field correctly, changing an Excel import setting cannot always restore the intended records; the source file may need to be corrected.
Keep the original file as a reference when troubleshooting. A text editor that can display line endings and search for quotation marks can help establish whether the multiline value is enclosed in quotes. Avoid editing the file in a basic editor unless you can preserve its encoding and punctuation: accidentally removing a closing quote can make all following records appear to merge.
Choose the right delimiter and text encoding
A correct line-break parse is only part of a successful import. The delimiter controls where Excel divides fields into columns. Commas are common, but some systems produce semicolon-delimited files, and tab-delimited text may also be saved with a CSV-like workflow. In the preview, check that values such as names, dates, and IDs land in the expected columns. If a whole row appears in one column, the delimiter may be wrong; if values are split unexpectedly, it may be wrong in the other direction.
Also check the file’s text encoding, particularly when names or comments contain accented letters, non-Latin characters, or symbols. A mismatch can produce garbled characters even when the rows and columns are parsed correctly. The importer’s preview is useful for spotting this before loading. If the CSV uses UTF-8, select the matching file origin or encoding option when it is available in the import interface.
Excel may also interpret text that looks like a date, number, or formula as a typed value. This matters for leading zeros in IDs and for long numeric identifiers. When those values must remain exactly as written, use Transform Data to inspect the column types and set sensitive columns to text before loading. A visually correct row structure does not guarantee that every value has retained its original representation.
What to do if Excel splits a multiline field
First determine whether the source file is valid. Find the affected field in a text editor and check that an opening quotation mark appears before its first line and a matching closing mark appears after its last line. Check that any quotation marks within the text are doubled. Then look at the delimiter and encoding in Excel’s preview. These checks address the most common reasons a multiline field is divided or columns shift.
- The preview shows extra rows: check whether the field is enclosed in quotes and whether the quote marks are balanced.
- Columns shift after one record: look for a missing closing quote, an unescaped quote, or a delimiter inside an unquoted field.
- Everything appears in one column: choose the delimiter actually used by the file.
- Characters look corrupted: try the appropriate text encoding in the import options.
- Some IDs lose leading zeros: import that column as text instead of accepting automatic number conversion.
If the file has unquoted line breaks inside a field, there is no universally safe way for Excel to know which breaks are part of the text and which end a record. Ask the system that created the file to export valid quoted CSV, or request another format such as an Excel workbook. For a small, well-understood file, you may be able to repair the source text, but make a copy first and verify record counts and values afterward.
Keep the line break or remove it after import
Once the field imports into one cell, Excel can display its embedded line break. Select the cell and use Home > Wrap Text if you want the lines visible within the cell. You may also need to adjust the row height. A line break inside the cell is content; it is not the same as text wrapping, which merely changes how text is displayed to fit the column width.
If you need a single-line version, work on a copy of the imported column so the original remains available. With the original text in A2, enter this in B2 to replace Windows-style CRLF pairs and any remaining CR or LF characters with spaces:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)&CHAR(10)," "),CHAR(13)," "),CHAR(10)," ")
For example, if A2 contains North, a line break, and South, the formula returns North South. Fill the formula down for other rows. Review the results before replacing the original data: multiple consecutive line breaks become multiple spaces, and a line break may have been meaningful formatting rather than unwanted text. This formula works in Microsoft 365 on Windows and Mac.
Windows, Mac, and Excel for the web
The steps above use Microsoft 365 for Windows. Excel for Mac has text-import and Power Query capabilities, but available commands and the import interface can vary by release. Look on the Data tab for the text or CSV import command available in your version, and use its preview to confirm the parsed rows before loading. If the Mac interface offers a choice between opening the file directly and importing it through a data workflow, the preview-based workflow gives you a chance to check the delimiter and text interpretation.
Excel for the web has a different feature set and does not provide the same desktop CSV import workflow in every situation. If the file contains important multiline fields, import it with Excel desktop or have a correctly formatted workbook prepared, then open that workbook in the browser. Regardless of platform, preserve a copy of the original CSV and verify a few multiline records after loading.
Verify the result before using the data
Do not rely only on the first few rows of the preview when the file is important. Compare the number of logical records expected with the number of data rows loaded, allowing for a header row if present. Check records before and after a multiline field, because one malformed quote can affect the interpretation of later rows. Confirm that the values on either side of the line break are in the same cell and that neighboring columns still match the correct record.
For repeat imports, use Data > From Text/CSV again and consider saving the transformation steps in Power Query. This can make recurring cleanup more consistent than manually opening and editing each CSV. Still review the result when the source system changes its export format; a saved query cannot make malformed or unexpectedly structured source data trustworthy by itself.
Frequently Asked Questions
Can a CSV cell contain a line break?
Yes. The field must be enclosed in double quotation marks so a CSV-aware importer can distinguish the embedded break from a record boundary. Any quotation marks inside the field must also follow CSV escaping rules.
Why does Excel put the second line on a new row?
The line break may not be inside a properly quoted field, or the file may have an unmatched quotation mark. Check the raw CSV and the import preview. Excel cannot infer the intended structure reliably when the source is ambiguous.
Will double-clicking the CSV work?
It may open a simple, correctly formatted CSV as expected, but you have less opportunity to review import choices first. Use Data > From Text/CSV when you need to check the delimiter, encoding, column types, or multiline records.
How do I show the line break inside an Excel cell?
After importing the field into one cell, select it and turn on Home > Wrap Text. Adjust the row height if necessary. Wrapping displays the embedded newline; it does not create or repair one.
Can I remove line breaks from imported text?
Yes. Use a replacement formula on a separate column, such as the formula above, and inspect the output before using it in place of the original. Retaining the source column makes it easier to recover meaningful formatting or check unexpected changes.
Related
- Hide Excel Columns Based on Cell Values Automatically
- Forgot Excel Sheet Password? Safe Recovery Options
- How to Lock and Protect an Excel Sheet in Microsoft 365
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Add a Named Range in Excel: Steps, Uses, and Helpful TipsTo add a named range in Excel for Microsoft 365 on Windows, select the cell or range, click…
- Excel Date to String: Format Dates as TextTo convert an Excel date to a text string, use the TEXT function: with a date in A2,…
- Microsoft Word Compare Documents Not Responding? FixesIf Microsoft Word’s Compare Documents command is not responding, first give it a little time, then try comparing…
- Remove a Page Break in Excel: Manual and AutomaticTo remove a manual page break in Excel for Microsoft 365 on Windows, select the cell immediately below…
- Google Sheets: How to Duplicate a Workbook and Share ItTo duplicate an entire Google Sheets workbook in a web browser, open it and choose File > Make…
- Goal Seek in Excel: Step-by-Step InstructionsTo use Goal Seek in Excel for Microsoft 365 on Windows, select Data > What-If Analysis > Goal…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.