Aglet

Triage CSV Rows Split by Quoted Line Breaks

A single CSV record can span several physical lines when a quoted field contains a newline. If imported rows appear shifted or incomplete, first establish whether the source contains valid multiline fields. Counting line breaks alone can exaggerate the number of expected records.

Establish what is happening

  1. Identify one complete logical record

    Choose a sanitized example containing a multiline description or note. Mark the opening quote, embedded newline, closing quote, and next real record boundary. Compare the intended field values with the import preview, keeping physical line numbers separate from logical record numbers.

  2. Locate the split in the flow

    Check whether the source file, preview, validation report, and saved data agree on the record boundary. Record the first stage that turns an embedded newline into a new row. A downstream missing-column error may be a consequence of that earlier split.

  3. Compare a single-line equivalent

    Use the same fields with the embedded newline replaced by a space in a controlled copy. Compare both files without changing delimiter or escaping settings. If both fail, keep other structural explanations in scope rather than attributing the result to multiline handling.

What to carry forward

Triage should identify the complete source record, expected row count, first incorrect split, and a contrasting single-line case. State whether the quotes are balanced. Without the original record structure, an error line number alone cannot establish which field or import stage is responsible.

Technical background: DuckDB documentation.

Keep the decision with the work.

Use a Work Item in Aglet to record the problem, the evidence you have, and the next decision. Add an owner and priority, then keep updates in the discussion so the next person can follow the reasoning.

Create an account See the product workflow