mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 18:25:45 +00:00
13 lines
243 B
Text
13 lines
243 B
Text
for (key in $*) {
|
|
@key_counts[key] += 1;
|
|
}
|
|
@record_count += 1;
|
|
|
|
end {
|
|
for (key in @key_counts) {
|
|
@key_fraction[key] = @key_counts[key] / @record_count
|
|
}
|
|
emit @record_count;
|
|
emit @key_counts, "key";
|
|
emit @key_fraction,"key"
|
|
}
|