miller/test/cases/verb-skip-trivial-records/0009/should-fail
John Kerl b515e6f18a Say so in the error message when a CSV/TSV length-mismatch line is blank (#1572)
Trailing blank lines at the end of a CSV/TSV file produce a
header/data length mismatch error which, especially for large files,
gives no clue that the offending line is simply blank. Since #2146
(issue #1535), the skip-trivial-records verb is an opt-in way to have
such lines skipped -- but users hitting the error had no pointer to it.

Now, when the mismatching input line is blank, the CSV and TSV readers
append a hint to the error message:

  mlr: CSV header/data length mismatch 2 != 1 at filename tmp.csv row 4; this input line is blank -- use the skip-trivial-records verb to have blank input lines skipped

Errors for genuinely ragged, non-blank lines are unchanged, as is all
non-error behavior. Also adds a note to the CSV/JSON troubleshooting
docs page about trailing blank lines and skip-trivial-records.

Addresses #1572.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:43:57 -04:00

0 lines
Text