csvkitHow to convert JSON to CSV using csvkit?
csvkit is a suite of command-line tools for converting to and working with CSV, the king of tabular file formats. It can be used to convert JSON to CSV.
Example code
csvjson myfile.json > myfile.csv
Output example
id,name,age
1,John,20
2,Jane,30
3,Joe,40
The code above uses the csvjson command to convert a JSON file to a CSV file. The csvjson command takes a JSON file as input and outputs a CSV file.
Code explanation
- csvjson: the command used to convert a JSON file to a CSV file
- myfile.json: the JSON file to be converted
- myfile.csv: the output CSV file
Helpful links
- csvkit documentation: https://csvkit.readthedocs.io/en/latest/
- csvkit GitHub repository: https://github.com/wireservice/csvkit
More of Csvkit
- How to convert a tsv file to csv with csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to skip the first line with csvkit?
- How to merge multiple files with csvkit?
- How to convert a json file to csv with csvkit?
- How to fetch unique values with csvkit?
- How to use csvkit on Windows?
- How to extract a column from a CSV file using csvkit?
- How to split a csv file with csvkit?
See more codes...