mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 10:15:36 +00:00
27 lines
444 B
Text
27 lines
444 B
Text
# ================================================================
|
|
# Sample CSV input:
|
|
#
|
|
# $ cat input.csv
|
|
# a,b
|
|
# 1,4
|
|
# 2,5
|
|
# 3,6
|
|
#
|
|
# Invocation:
|
|
#
|
|
# $ mlr --icsv --ojson put -q -f mkstan.mlr input.csv
|
|
#
|
|
# Sample JSON output:
|
|
#
|
|
# {
|
|
# "a": [1, 2, 3],
|
|
# "b": [4, 5, 6]
|
|
# }
|
|
# ================================================================
|
|
|
|
for (k, v in $*) {
|
|
@output_record[k][NR] = v;
|
|
}
|
|
end {
|
|
emit @output_record
|
|
}
|