Tablora · Library
Preserve a line break inside a table cell
A quoted CSV cell can hold a line break, so one record spans two physical lines. Count parsed rows, not lines, and check how each export treats it.
One record, two lines of text
Addresses, delivery notes and comments often contain line breaks. CSV allows that when the field is quoted: everything between the opening and closing quote belongs to one cell, line breaks included. In a text editor the record looks like two lines; in a correct import it is one row with one multi-line cell.
That is why counting lines is not a reliable way to count records. A file can have more physical lines than records without any reading error on either side.
This matters for any check that counts lines, such as the line count an editor or a command-line tool reports. Use the Rows figure from the inspector instead, which counts parsed records.
Example: First line and Second line
The page example has a header id,note and a record whose note is "First line" and "Second line" on two lines inside one pair of quotes. With comma as the Delimiter the inspector reports 2 rows and 2 columns, not 3 rows. Row 2, column 2 contains First line, a line break, and Second line, all in one cell.
Inspecting multi-line notes
- Choose the Delimiter explicitly rather than relying on detection, so the quoted field is read with the right separator.
- Press Calculate and compare Rows with the number of records in the source, not with the number of lines.
- Look at the note cell in the preview and confirm both lines are in it.
- If Rows is higher than expected, a note was probably not quoted in the source and its second line became a record of its own.
- Download only when the preview shows each note in a single cell.
How each export handles the line break
- Download (CSV) wraps the cell in quotes and keeps the line break, so another CSV reader sees one cell.
- Download (XLSX) from the text-safe converter keeps the line break inside the text cell.
- The Tablora app's CSV export also quotes any cell that contains a line break.
- The app's Copy option, which pastes straight into a spreadsheet, replaces line breaks and tabs inside cells with spaces, because a pasted line break would start a new row. Use XLSX or CSV from the app when the break itself matters.
When the receiving program disagrees
Some import dialogs have an option for line breaks in quoted fields, and some tools do not support them at all. If the receiving program splits the note, check its import settings first; the file itself is already correct when the inspector shows 2 rows here.
Original synthetic example
- Input
- id,note 1,"First line Second line"
- Delimiter
- ,
- Expected records
- 2
- Columns in the first record
- 2
- Cell to inspect
- Row 2, column 2: First line Second line