Ragged Rows Wrong-Field-Count Finder

Report CSV records whose decoded field count differs from an explicit expected width, including header and blank records; indices are zero-based records, not lines.

Description

Ragged CSV records have different field counts from the intended width.

Ragged CSV records have different field counts from the intended width. Quoted delimiters and multiline cells make parsing necessary before counting.1

Report CSV records whose decoded field count differs from an explicit expected width, including header and blank records; indices are zero-based records, not lines.

When to use Ragged Rows Wrong-Field-Count Finder

Use this for the following task: Report CSV records whose decoded field count differs from an explicit expected width, including header and blank records; indices are zero-based records, not lines.

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 Ragged Rows Wrong-Field-Count Finder 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, expectedColumns using the field table, then run the tool.
  3. Read consistent, recordIndices. 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
expectedColumnsExpected columnsinteger; minimum 1Required

Parse logical records, compare every row with the explicit expected width and return zero-based record indices plus an overall flag.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.

inconsistent record when decoded field count != expectedColumns

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

Output fieldMeaningValue type
consistentConsistentboolean
recordIndicesRecord indiceslist of integer
json
{
  "input": {
    "csv": "a,b\nc\nd,e,f",
    "delimiter": ",",
    "expectedColumns": 2
  },
  "output": {
    "consistent": false,
    "recordIndices": [
      1,
      2
    ]
  }
}

Limitations and assumptions

Header and blank records are included. This reports width discrepancies without padding or removing fields.

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 Fill Missing Cells Default Value for this operation: Pad short CSV records to an explicit width with a default string, preserving present empty fields and rejecting longer records; output materialization is bounded. For a complementary task, use Column Select By Indices for this operation: Select and reorder zero-based columns from a rectangular CSV, allowing repeated selections while requiring at least one output column.

Further background: Format and language reference: Ragged Rows Wrong-Field-Count Finder.

References

  1. Format and language reference: Ragged Rows Wrong-Field-Count Finder — RFC Editor

  2. Ragged Rows Wrong-Field-Count Finder — tool.io

Similar or alternative tools

  • Fill Missing Cells Default Value

    Pad short CSV records to an explicit width with a default string, preserving present empty fields and rejecting longer records; output materialization is bounded.

  • Column Select By Indices

    Select and reorder zero-based columns from a rectangular CSV, allowing repeated selections while requiring at least one output column.

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