miller/pkg/input
John Kerl 78363f1cc3
DKVPX reader: honor --ifs and --ips instead of hard-coding comma and equals (#2172)
The DKVPX record reader set dkvpxReader.Comma = ',' unconditionally,
ignoring the resolved --ifs value; the key-value separator '=' was
likewise hard-coded in the dkvpx parser, ignoring --ips. So e.g.

  printf 'a=1;b=2\n' | mlr -i dkvpx --ifs semicolon --ojson cat

produced a single field {"a": "1;b=2"} instead of {"a": 1, "b": 2}.

Fixes:

* pkg/dkvpx.Reader gains an Equals field (default '=') alongside Comma.
* The DKVPX record reader now passes the resolved IFS/IPS through,
  validating that each is a single character (mirroring the CSV
  reader's "IFS can only be a single character" error) rather than
  silently ignoring or truncating them.
* The DKVPX record writer already emitted OFS/OPS, but its quoting
  decisions were based on the default separators, so with --ofs
  semicolon a value containing ';' went out unquoted (ambiguous) while
  a value containing ',' was quoted needlessly. Quoting now keys off
  the actual OFS/OPS.

Adds unit tests, regression cases under test/cases/io-dkvpx/, and a
note in the separators reference table.

Discovered while investigating #369; tracked in #2170.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 17:37:07 -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 DKVPX reader: honor --ifs and --ips instead of hard-coding comma and equals (#2172) 2026-07-06 17:37:07 -04:00
record_reader_dkvpx_test.go DKVPX reader: honor --ifs and --ips instead of hard-coding comma and equals (#2172) 2026-07-06 17:37:07 -04: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.