jsonobjects2csv
jsonobjects2csv OPTIONS [JSON_FILENAME] [YAML_FILENAME]
jsonobjects2csv is a tool that converts a JSON list of objects into CSV output.
jsonobjects2csv will take JSON expressing a list of objects and turn them into a CSV representation. If the object’s attributes include other objects or arrays they are rendered as YAML in the cell of the csv output.
Used by typing into standard in (press Ctrl-d to end your input).
jsonobjects2csv
[
{"one": 1, "two": 2},
{"one": 10, "two": 20},
]
^D
This should yield the following.
one,two
1,2
10,20
These would get the file named “my_list.json” and save it as my.csv
jsonobjects2csv my_list.json > my.csv
jsonobjects2csv my_list.json my.csv
cat my_list.json | jsonobjects2csv -i - > my.csv
jsonobjects2csv 1.2.10