Multiline Quoted Cell Line Counter

Find decoded CSV cells containing CR or LF and report their one-based line counts, counting CRLF as one break; positions are zero-based record and column indices.

Description

A decoded CSV cell may contain several lines while belonging to one record.

A decoded CSV cell may contain several lines while belonging to one record. Counting CRLF as one break avoids double-counting Windows line endings.1

Find decoded CSV cells containing CR or LF and report their one-based line counts, counting CRLF as one break; positions are zero-based record and column indices.

When to use Multiline Quoted Cell Line Counter

Use this for the following task: Find decoded CSV cells containing CR or LF and report their one-based line counts, counting CRLF as one break; positions are zero-based record and column indices.

Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.

How to use Multiline Quoted Cell Line Counter and understand its results

  1. Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
  2. Enter csv, delimiter using the field table, then run the tool.
  3. Read cells. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
csvCSV textstring; maximum text length 100000Required
delimiterDelimiterstring; choose ",", ";", "\t"Required

Parse records and inspect every decoded cell, including any header. Return only cells containing line breaks with zero-based record/column positions and one-based line counts.2

Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.

lineCount = count(CRLF or standalone CR/LF breaks)+1

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
cellsCellslist of record: record (integer), column (integer), lineCount (integer)
json
{
  "input": {
    "csv": "id,note\n1,\"a\r\nb\nc\"",
    "delimiter": ","
  },
  "output": {
    "cells": [
      {
        "record": 1,
        "column": 1,
        "lineCount": 3
      }
    ]
  }
}

Limitations and assumptions

This does not count visual wrapped lines. Embedded ending characters remain part of the cell.

Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.

Alternative or Complementary methods

Choose Quoted Multiline Safe Splitter for this operation: Split CSV into raw record fragments without outer record endings, preserving quote spelling, embedded line endings, blank records, and escaped quote pairs. For a complementary task, use Line Count vs Record Count Reconciler for this operation: Compare physical CSV line count with logical record count, treating CRLF as one break and a terminal ending as no extra line; embedded quoted breaks explain the excess physical lines.

Further background: Format and language reference: Multiline Quoted Cell Line Counter.

References

  1. Format and language reference: Multiline Quoted Cell Line Counter — RFC Editor

  2. Multiline Quoted Cell Line Counter — tool.io

Similar or alternative tools

  • Quoted Multiline Safe Splitter

    Split CSV into raw record fragments without outer record endings, preserving quote spelling, embedded line endings, blank records, and escaped quote pairs.

  • Line Count vs Record Count Reconciler

    Compare physical CSV line count with logical record count, treating CRLF as one break and a terminal ending as no extra line; embedded quoted breaks explain the excess physical lines.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies