top of page

CSV Notes Span Two Lines: Count Parsed Records Before Splitting a Handover File

Nov 11
4 min read

An export contains 100 maintenance records, but a line-based check reports more rows and a file splitter creates broken fragments. A quoted note can contain its own line break. Parse the agreed CSV dialect before counting records, assigning error locations or dividing the file into batches.


Concept illustration: CSV Notes Span Two Lines: Count Parsed Records Before Splitting a Handover File
Original conceptual illustration; not a specific product, live software screen or customer installation.

Key takeaways

Physical text lines and logical CSV records are different concepts when quoted fields contain line breaks. Keep the parser’s record boundaries, field counts and source locations in the handover evidence.


1. Confirm the file contract


RFC 4180 describes a common CSV format in which fields containing line breaks, commas or double quotes are enclosed in double quotes. An embedded double quote is escaped by doubling it. The document is informational; it does not establish that every exporter or importer uses the same dialect.


Use a ProSight Software reporting assessment to confirm the actual supported handover route and file requirements. This guide addresses a file-preparation check, not an assurance that every ProSight Software deployment provides a particular CSV import or batch-splitting feature.


Document encoding, delimiter, quotation rules, line endings, expected columns and the treatment of notes. Keep an unchanged source file. A visual spreadsheet view may hide the physical line breaks that caused the original automated workflow to fail.


2. Follow one complete logical record


Imagine a synthetic record with three fields: asset_id, measured_value and note. Its note says Checked seal, then contains a line break, then says Recheck tomorrow. Under the agreed quoted-field format, that remains one field within one logical record, even though the text occupies multiple physical lines.


A naive split at every newline can create an extra apparent record beginning with Recheck tomorrow. The resulting fragment may have too few columns, lose its asset identifier or be incorrectly attached to another record. Do not join fragments by guessing which neighbouring text looks plausible.


Inspect the parser’s complete output for the fixture: exactly three fields, one intact note and the original asset identity. Also retain the source location range for a record that spans lines, so a later error report leads technicians to the actual input.


3. Count and batch after parsing


Reconcile logical source records against accepted and rejected records. State whether a header is included in any count. A physical-line total can still be useful as a diagnostic observation, but label it accurately instead of treating it as the number of measurements.


If a large handover must be divided, use a supported CSV-aware method that preserves complete records and the agreed header policy. Do not cut the source after every fixed number of text lines. A cut through an open quoted field can invalidate both resulting files.


Preserve a stable record identity and the batch relationship in the audit trail. Splitting must not silently duplicate a header as a measurement or discard the final record merely because the original file has no terminal line break. Verify the supported behaviour with fixtures rather than assuming it.


One multiline field; one logical record. Synthetic handover example; confirm the actual CSV dialect.
Synthetic handover example; confirm the actual CSV dialect.

Diagnostic checks


Observation

Check

More physical lines than records

Look for quoted multiline fields

Batch begins inside a note

Inspect the splitting boundary

Parser reaches end inside a quote

Report malformed syntax; preserve source


4. Add deliberate boundary cases


Build a small synthetic test set containing a plain note, quoted comma, embedded line break, escaped double quote and an empty optional note. Include a malformed case with an unclosed quoted field. The expected outcome should distinguish valid multiline content from a genuine syntax error.


Set appropriate size and resource limits for records and fields. A parser waiting indefinitely for a closing quote is not a useful failure mode. Preserve the input and a specific diagnostic reason when the supported parser rejects a record or file.


Keep CSV syntax validation separate from measurement validation. Correct quotation does not make a missing asset identifier, invalid number or unknown unit acceptable. Likewise, an otherwise valid reading should not acquire a different identity because a note was split incorrectly.


5. Make the result usable at handover


Record the exporter and parser versions, file contract, logical record count, accepted count and explicit failures. Compare representative parsed values and notes with the unchanged source. If content is re-exported, confirm that the receiving application reconstructs the same fields.


For a ProSight Custom integration, agree the preparation and validation responsibilities before implementation. Confirm the supported file interface and exception workflow. The original diagram in this guide illustrates a requirement; it is not a screenshot of an existing product function.


Do not repair a production file through broad newline removal. That can merge separate records and alter meaningful notes. Resolve the parser or batching boundary, repeat the fixture checks and retain the approved correction with the handover record.


Practical handover checklist


  1. Preserve the source and document its CSV dialect.

  2. Parse complete quoted fields before counting records.

  3. Split only at logical record boundaries with an approved method.

  4. Reconcile accepted and rejected records and verify unchanged field values.


Recommended equipment / related solutions


Review the ProSight Software platform overview to align the software scope with your measurement and reporting requirements. Confirm the selected deployment and integration route before implementation.


For an engineered interface or commissioning workflow, discuss ProSight Custom with a sanitised example and explicit acceptance criteria. Agree the deliverables rather than assuming a conceptual test is an available product feature.



Frequently asked question


Can I remove every newline inside the file?


No. Some newlines separate records and others may be part of quoted field content. Parse the agreed dialect first and preserve meaningful source data.


Technical reference



Need help with your application?


Discuss this application and request a project assessment. Send the exact equipment models, interface documentation and a sanitised example. Confirm compatibility, supported functions and acceptance scope before purchase or deployment.






Comments


prosight-software-logo (1).png
bottom of page