mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-19 01:15:21 +00:00
19 lines
313 B
Bash
Executable file
19 lines
313 B
Bash
Executable file
mlr --from data/small put -q '
|
|
begin {
|
|
@o = {
|
|
"nrec": 0,
|
|
"nkey": {"numeric":0, "non-numeric":0},
|
|
};
|
|
}
|
|
@o["nrec"] += 1;
|
|
for (k, v in $*) {
|
|
if (is_numeric(v)) {
|
|
@o["nkey"]["numeric"] += 1;
|
|
} else {
|
|
@o["nkey"]["non-numeric"] += 1;
|
|
}
|
|
}
|
|
end {
|
|
dump @o;
|
|
}
|
|
'
|