mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
The uniq verb outputs only the group-by columns, and issue #1075 asks for a way to deduplicate on some fields while keeping the rest. Miller already supports this via "head -n 1 -g", but that wasn't discoverable from uniq's help text or its reference-verbs section. Add a note to "mlr uniq --help" and a short recipe (with live examples) to the uniq section of the verbs reference, and regenerate the derived man page, docs, and CLI-help golden files. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
a707a155f2
commit
a63ea57359
7 changed files with 92 additions and 0 deletions
|
|
@ -169,6 +169,9 @@ func transformerUniqUsage(
|
|||
fmt.Fprintf(o, "count-distinct. For uniq, -f is a synonym for -g. Output fields are\n")
|
||||
fmt.Fprintf(o, "written in the order in which they are named with -g or -f, not in the\n")
|
||||
fmt.Fprintf(o, "order in which they appear in the input records.\n")
|
||||
fmt.Fprintf(o, "To deduplicate records by one or more fields while keeping all other\n")
|
||||
fmt.Fprintf(o, "fields, use head: e.g. \"%s head -n 1 -g hash\" keeps the first record\n", argv0)
|
||||
fmt.Fprintf(o, "for each distinct value of the hash field, with all fields intact.\n")
|
||||
fmt.Fprintf(o, "\n")
|
||||
WriteVerbOptions(o, uniqOptions)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue