miller/doc/data/for-oosvar-example-0f.sh
2016-06-07 21:34:31 -04:00

14 lines
361 B
Bash

mlr --from data/small head -n 2 then put -q '
begin {
@myvar["nesting-is-too-shallow"] = 1;
@myvar["nesting-is"]["just-right"] = 2;
@myvar["nesting-is"]["also-just-right"] = 3;
@myvar["nesting"]["is"]["too-deep"] = 4;
}
end {
for ((k1, k2), v in @myvar) {
@terminal[k1][k2] = v
}
emit @terminal, "index1", "index2"
}
'