miller/pkg/input
John Kerl a707a155f2
Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146)
When the skip-trivial-records verb is in the then-chain, the CSV/TSV
record-readers now silently skip trivial (all-fields-empty) input lines
-- notably blank lines at the end of a CSV file -- instead of raising a
fatal header/data length mismatch. The user has explicitly asked for
trivial records to be skipped, so mlr now exits 0 in this case.

The verb's CLI parser sets a new ReaderOptions.SkipTrivialRecords flag,
which the CSV and TSV readers consult only on the would-be-fatal
mismatch path, so:

* Behavior without the verb is unchanged: blank lines still error.
* Genuinely ragged non-trivial records still error even with the verb.
* --allow-ragged-csv-input behavior is unchanged.

Fixes #1535.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:22:51 -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 Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -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 Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -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 Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -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.