Why line 4 is record 3
RFC 4180 is an Informational document describing line breaks inside quoted fields. Here, first and second are two lines in one cell. Text wrapping caused by the screen width is different from an actual line break in the input.
id,note
001,"first
second"
002,ok,extraThe input above has 4 physical lines and 3 records including the header. Moyoutil reported 2 expected columns and 3 actual columns in the last record, at line 4, record 3. The line break inside the cell does not add another record.
Check the column count and the original values
Change the last line to 002,ok only if extra was added by mistake. If it is real data, keep the value and decide how the header and other records should be structured. Under this assumption, the corrected input produces 2 data rows and 2 columns, preserving the actual newline in note and the string 001 in id.
[
{"id":"001","note":"first\nsecond"},
{"id":"002","note":"ok"}
]Use the tool’s error-location button to inspect the input, then convert again. An unclosed-quote error may point to the opening quote where parsing went wrong. Adding one final line break differs from adding an empty record. Keep the original and check the actual delimiter.
Frequently Asked Questions
Should I delete every line break?
No. A line break may be part of a cell value. In this example, preserve the cell’s newline and fix the last record’s column count. Other CSV programs may use different diagnostic locations or dialect rules.