miller/pkg/input
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
..
constants.go Separate out ILineReader abstraction (#1504) 2024-02-24 22:07:56 -05:00
doc.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
fixed_width_splitter.go Some fixes for staticcheck (#2006) 2026-03-03 09:27:03 -05:00
fixed_width_splitter_test.go Add fixed width support for pprint reader (#1999) 2026-03-01 11:25:17 -05:00
line_reader.go Next batch of lint fixes (#2108) 2026-06-28 17:36:36 -04:00
pseudo_reader_gen.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
record_reader.go Say so in the error message when a CSV/TSV length-mismatch line is blank (#1572) 2026-07-06 15:43:57 -04:00
record_reader_benchmark_test.go Replace list.List with Go slices (#1950) 2026-02-01 17:22:28 -05:00
record_reader_csv.go Say so in the error message when a CSV/TSV length-mismatch line is blank (#1572) 2026-07-06 15:43:57 -04:00
record_reader_csvlite.go Fix dedupe-field-names clobbering values on ragged short rows (#1997) (#2144) 2026-07-06 15:20:25 -04:00
record_reader_dcf.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvp_nidx.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvp_test.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvpx.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvpx_test.go Add DKVPX file format (#2002) 2026-03-02 22:35:08 -05:00
record_reader_factory.go Add DKVPX file format (#2002) 2026-03-02 22:35:08 -05:00
record_reader_json.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_markdown.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_reader_pprint.go Fix dedupe-field-names clobbering values on ragged short rows (#1997) (#2144) 2026-07-06 15:20:25 -04:00
record_reader_tsv.go Say so in the error message when a CSV/TSV length-mismatch line is blank (#1572) 2026-07-06 15:43:57 -04:00
record_reader_xtab.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_yaml.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
splitters.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00

Logic for parsing disk-file/standard-input byte streams into records.

There is one record-reader type per supported input file format, and a factory method.