Field-With-Linebreaks Flagger

Find zero-based cell indices containing CR or LF characters, treating both individual line endings and CRLF as line-break presence.

Description

A newline inside a decoded CSV cell is field content and can span several physical lines when correctly quoted.

A newline inside a decoded CSV cell is field content and can span several physical lines when correctly quoted. Identifying such cells helps explain why record counts and line counts differ.1

Find zero-based cell indices containing CR or LF characters, treating both individual line endings and CRLF as line-break presence.

When to use Field-With-Linebreaks Flagger

Use this tool to find zero-based cell indices containing CR or LF characters, treating both individual line endings and CRLF as line-break presence.

Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.

How to use Field-With-Linebreaks Flagger and understand its results

  1. Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.
  2. Enter values using the field table and calculation rules, then run the tool.
  3. Read cellIndices. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
valuesValueslist of string; maximum length: 10000; minimum entries: 0; maximum entries: 10000Required

Supply decoded cell strings. The tool checks each for any CR or LF and returns the zero-based indices of matching cells in their original order. Each cell appears once, whether it contains one newline or several; CRLF is also a match.

flagged cell contains CR U+000D or LF U+000A

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
cellIndicesCell indiceslist of integer; minimum: 0
json
{
  "input": {
    "values": [
      "plain",
      "a\r\nb",
      "a\nb"
    ]
  },
  "output": {
    "cellIndices": [
      1,
      2
    ]
  }
}

Limitations and assumptions

This does not parse CSV, verify quoting, count lines or flag Unicode line separators U+2028 and U+2029. A flagged cell can be valid CSV content rather than an error. Use the full-document validator when the question concerns record structure.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Cell-string lists also have a combined text budget of 100,000 UTF-16 units per list. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use RFC 4180 Quoted Field Parser Check: Check RFC 4180 field quoting with explicit Unicode and CR/LF extensions; blank records are retained, and field-width consistency is checked separately. For a complementary task, use Control Character Finder In Fields: Locate C0 and C1 control characters, including DEL, in cell strings and report cell index, UTF-16 offset, and code point; tabs and line breaks are included.

References

  1. Field-With-Linebreaks Flagger — tool.io

Similar or alternative tools

  • RFC 4180 Quoted Field Parser Check

    Check RFC 4180 field quoting with explicit Unicode and CR/LF extensions; blank records are retained, and field-width consistency is checked separately.

  • Control Character Finder In Fields

    Locate C0 and C1 control characters, including DEL, in cell strings and report cell index, UTF-16 offset, and code point; tabs and line breaks are included.

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