Conversation

Flatten a Tweet If you have a json object and want to completely flatten it (perhaps as a first step towards a CSV dump), the following works well: cat tweet.json | jq '. as $in | reduce leaf_paths as $path ({};. + { ($path | map(tostring) | join(".")): $in | getpath($path) })'
1
28
Show replies