csvkitHow to convert a csv file to json with 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 a csv file to json.
Example code
csvjson input.csv > output.json
Output example
{
"name": "John Doe",
"age": "30",
"city": "New York"
}
Code explanation
- csvjson: This is the command used to convert a csv file to json.
- input.csv: This is the name of the csv file that needs to be converted.
- output.json: This is the name of the json file that will be created after the conversion.
Helpful links
More of Csvkit
- How to select specific columns with csvkit?
- How to rename a column with csvkit?
- How to fetch unique values with csvkit?
- How to convert a tsv file to csv with csvkit?
- How to split a csv file with csvkit?
- How to reorder columns with csvkit?
- How to merge columns with csvkit?
- How to remove duplicates with csvkit?
- How to skip the first line with csvkit?
- How to use csvkit on Windows?
See more codes...