miller/pkg/transformers
John Kerl a8ee858e60
reorder -r: group matched fields by regex order, not record order (#2159)
With multiple regexes, 'mlr reorder -r' previously emitted all matched
fields in record order, ignoring the order the regexes were given. Now
matched fields are grouped by regex-list order (first regex's matches
first, then the second's, etc.); within each group, fields keep their
record order. A field matching multiple regexes is claimed by the first
one. This makes 'reorder -r' consistent with 'cut -orf' and satisfies
the original request in #1325: -r '^YYY,^XXX' puts YYY-prefixed fields
first, then XXX-prefixed fields, then the rest. Applies to -e, -b, and
-a modes as well.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:07:16 -04:00
..
utils Convert if/else-if chains to typed switch statements (staticcheck QF1003) (#2112) 2026-06-28 18:27:42 -04:00
aaa_chain_transformer.go Performance and style fixes (#1981) 2026-02-18 09:19:31 -05:00
aaa_record_transformer.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
aaa_transformer_json.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
aaa_transformer_json_test.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
aaa_transformer_table.go Add mlr describe schema/shape introspection verb (#2098 PR6) (#2132) 2026-07-03 18:43:49 -04:00
aaa_verb_usage.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
altkv.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
bar.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
bootstrap.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
case.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
cat.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
check.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
clean_whitespace.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
count.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
count_similar.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
cut.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
decimate.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
describe.go Add mlr describe schema/shape introspection verb (#2098 PR6) (#2132) 2026-07-03 18:43:49 -04:00
doc.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
fill_down.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
fill_empty.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
flatten.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
format_values.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
fraction.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
gap.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
grep.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
group_by.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
group_like.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
having_fields.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
head.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
histogram.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
join.go join: document --icsv etc. as accepted left-file format flags (#444) (#2143) 2026-07-05 20:10:49 -04:00
json_parse.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
json_stringify.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
label.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
latin1_to_utf8.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
merge_fields.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
most_or_least_frequent.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
nest.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
nothing.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
put_or_filter.go Add DSL validate/dry-run: put/filter --explain (#2098 PR5) (#2131) 2026-07-03 18:12:23 -04:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
regularize.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
remove_empty_columns.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
rename.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
reorder.go reorder -r: group matched fields by regex order, not record order (#2159) 2026-07-06 15:07:16 -04:00
repeat.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
reshape.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sample.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sec2gmt.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sec2gmtdate.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
seqgen.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
shuffle.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
skip_trivial_records.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sort.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sort_within_records.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
sparsify.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
split.go Copy records handed to async file-writers in tee and split verbs (#1671) (#2152) 2026-07-05 20:17:32 -04:00
stats1.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
stats2.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
step.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
subs.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
summary.go Document meaning of hyphenated field_type values in mlr summary (#1082) (#2149) 2026-07-05 20:34:16 -04:00
surv.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
tac.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
tail.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
tee.go Copy records handed to async file-writers in tee and split verbs (#1671) (#2152) 2026-07-05 20:17:32 -04:00
template.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
top.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
unflatten.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
uniq.go uniq: document that -g/-f output-field order follows the command line (#962) (#2145) 2026-07-05 20:09:26 -04:00
unspace.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
unsparsify.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00
utf8_to_latin1.go Tier-2 structured verb options: OptionSpec, initial migration (#2098) (#2111) 2026-07-03 14:27:23 -04:00

Logic for transforming input records into output records as requested by the user (sort, filter, etc.).:

  • The IRecordTransformer abstract record-transformer interface datatype, as well as the ChainTransformer Go-channel chaining mechanism for piping one transformer into the next.
  • The transformer lookup table, used for Miller command-line parsing, verb construction, and online help.
  • All the concrete record-transformers such as cat, tac, sort, put, and so on.