I\'m trying to convert an object that looks like this:
{
\"123\" : \"abc\",
\"231\" : \"dbh\",
\"452\" : \"xyz\"
}
To csv that looks
Jeff answer is a good starting point, something closer to what you expect:
cat input.json | jq 'to_entries | map([.key, .value]|join(","))'
[
"123,abc",
"231,dbh",
"452,xyz"
]
But did not find a way to join using newline:
cat input.json | jq 'to_entries | map([.key, .value]|join(","))|join("\n")'
"123,abc\n231,dbh\n452,xyz"