9951 explained code solutions for 126 technologies


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

Edit this code on GitHub