mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
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>
|
||
|---|---|---|
| .. | ||
| constants.go | ||
| doc.go | ||
| fixed_width_splitter.go | ||
| fixed_width_splitter_test.go | ||
| line_reader.go | ||
| pseudo_reader_gen.go | ||
| README.md | ||
| record_reader.go | ||
| record_reader_benchmark_test.go | ||
| record_reader_csv.go | ||
| record_reader_csvlite.go | ||
| record_reader_dcf.go | ||
| record_reader_dkvp_nidx.go | ||
| record_reader_dkvp_test.go | ||
| record_reader_dkvpx.go | ||
| record_reader_dkvpx_test.go | ||
| record_reader_factory.go | ||
| record_reader_json.go | ||
| record_reader_markdown.go | ||
| record_reader_pprint.go | ||
| record_reader_tsv.go | ||
| record_reader_xtab.go | ||
| record_reader_yaml.go | ||
| splitters.go | ||
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.