mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-23 07:59:37 +00:00
11 lines
252 B
Bash
11 lines
252 B
Bash
mlr --opprint --from data/small put -q '
|
|
@records[NR] = $*;
|
|
end {
|
|
for((I,k),v in @records) {
|
|
@records[I]["I"] = I;
|
|
@records[I]["N"] = NR;
|
|
@records[I]["PCT"] = 100*I/NR
|
|
}
|
|
emit @records,"I"
|
|
}
|
|
' then reorder -f I,N,PCT
|