Unbalanced Quote Per Row Detector

Double-quote parity diagnostics over ordered physical lines, preserving multiline quoted fields; not full CSV syntax validation or proof each odd line malformed.

Description

Unbalanced Quote Per Row Detector: return odd quote physical line indices, quote state transition line indices, unclosed quote at end.

A quote character can change whether a physical CSV line is inside a quoted field. Physical lines and logical records are not necessarily the same.

This tool returns odd quote physical line indices, quote state transition line indices, unclosed quote at end. Use the stated units and model convention when interpreting these fields.

When to use this tool

Use this tool when the supplied inputs match the specific operation described above and you need a repeatable result under its stated convention.

  • Check the supported input and output contract against an existing calculation or observation.
  • Use the complete example to confirm units, selector spelling and result interpretation.

How to use the tool and how it works

  1. Enter every field in the input table using the stated units and the exact supported selector spelling where applicable.
  2. Run the tool. Correct input errors before interpreting an output.
  3. Read the result fields below; use accompanying flags and the stated sign, boundary or model convention when interpreting a number.

Count literal double quotes on each supplied line modulo two. Toggle an open-quote state on odd-parity lines, and report those line indices and the final state.1

Input fieldMeaning and unitsAccepted input
physicalLinesPhysical lines.List of text values
Output fieldInterpretation
resultObject containing the following named result fields.
result.oddQuotePhysicalLineIndicesOdd quote physical line indices list, in the ordering described in the calculation.
result.quoteStateTransitionLineIndicesQuote state transition line indices list, in the ordering described in the calculation.
result.unclosedQuoteAtEndUnclosed quote at end flag under the exact conditions described above.
json
{
  "input": {
    "physicalLines": [
      "a,\"b",
      "c\",d"
    ]
  },
  "output": {
    "result": {
      "oddQuotePhysicalLineIndices": [
        0,
        1
      ],
      "quoteStateTransitionLineIndices": [
        0,
        1
      ],
      "unclosedQuoteAtEnd": false
    }
  }
}

Limitations and assumptions

  • This is a parity screen, not a CSV parser. It does not validate delimiters, quoted-field placement or every malformed quoting pattern.
  • Every declared field is required and unexpected fields are rejected. Numeric inputs must be finite; input errors are distinct from a valid false result or an explicitly qualified output.
  • Extremely large inputs and nonfinite or excessively large outputs are rejected. List positions reported by the tool use zero-based indices unless stated otherwise.

Alternative or Complementary methods

Check the underlying observations, units and conventions independently before using the result in a larger workflow. The tools listed below address nearby tasks; compare their inputs and scope before substituting one for this operation.

References

  1. Tool behavior and example: Unbalanced Quote Per Row Detector — tool.io

Similar or alternative tools

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