DKVP --incr-key option (#1839)

* Code support for --incr-key

* Add source code for online help for new flag

* Run `make dev`
This commit is contained in:
John Kerl 2025-07-20 17:05:24 -04:00 committed by GitHub
parent d264f562dc
commit fccdf215e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 119 additions and 13 deletions

View file

@ -145,6 +145,7 @@ This is simply a copy of what you should see on running `man mlr` at a command p
mlr help comments-in-data-flags
mlr help compressed-data-flags
mlr help csv/tsv-only-flags
mlr help dkvp-only-flags
mlr help file-format-flags
mlr help flatten-unflatten-flags
mlr help format-conversion-keystroke-saver-flags
@ -356,6 +357,16 @@ This is simply a copy of what you should see on running `man mlr` at a command p
-N Keystroke-saver for `--implicit-csv-header
--headerless-csv-output`.
1mDKVP-ONLY FLAGS0m
These are flags which are applicable to DKVP format.
--incr-key Without this option, keyless DKVP fields are keyed by
field number. For example: `a=10,b=20,30,d=40,50` is
ingested as `$a=10,$b=20,$3=30,$d=40,$5=50`. With
this option, they're keyed by a running counter of
keyless fields. For example: `a=10,b=20,30,d=40,50`
is ingested as `$a=10,$b=20,$1=30,$d=40,$2=50`.
1mFILE-FORMAT FLAGS0m
See the File formats doc page, and or `mlr help file-formats`, for more
about file formats Miller supports.

View file

@ -124,6 +124,7 @@
mlr help comments-in-data-flags
mlr help compressed-data-flags
mlr help csv/tsv-only-flags
mlr help dkvp-only-flags
mlr help file-format-flags
mlr help flatten-unflatten-flags
mlr help format-conversion-keystroke-saver-flags
@ -335,6 +336,16 @@
-N Keystroke-saver for `--implicit-csv-header
--headerless-csv-output`.
1mDKVP-ONLY FLAGS0m
These are flags which are applicable to DKVP format.
--incr-key Without this option, keyless DKVP fields are keyed by
field number. For example: `a=10,b=20,30,d=40,50` is
ingested as `$a=10,$b=20,$3=30,$d=40,$5=50`. With
this option, they're keyed by a running counter of
keyless fields. For example: `a=10,b=20,30,d=40,50`
is ingested as `$a=10,$b=20,$1=30,$d=40,$2=50`.
1mFILE-FORMAT FLAGS0m
See the File formats doc page, and or `mlr help file-formats`, for more
about file formats Miller supports.

View file

@ -55,6 +55,7 @@ Flags:
mlr help comments-in-data-flags
mlr help compressed-data-flags
mlr help csv/tsv-only-flags
mlr help dkvp-only-flags
mlr help file-format-flags
mlr help flatten-unflatten-flags
mlr help format-conversion-keystroke-saver-flags

View file

@ -128,6 +128,15 @@ These are flags which are applicable to CSV format.
* `--quote-all`: Force double-quoting of CSV fields.
* `-N`: Keystroke-saver for `--implicit-csv-header --headerless-csv-output`.
## DKVP-only flags
These are flags which are applicable to DKVP format.
**Flags:**
* `--incr-key`: Without this option, keyless DKVP fields are keyed by field number. For example: `a=10,b=20,30,d=40,50` is ingested as `$a=10,$b=20,$3=30,$d=40,$5=50`. With this option, they're keyed by a running counter of keyless fields. For example: `a=10,b=20,30,d=40,50` is ingested as `$a=10,$b=20,$1=30,$d=40,$2=50`.
## File-format flags
See the File formats doc page, and or `mlr help file-formats`, for more