This is a simple Python script the converts a properly formatted CSV file into a separate JSON file.
This script requires Python version 3x.
In the csvToJson.py
file, ensure the .csv
filename matches your actual CSV filename:
with open('sample.csv'...
Also, in the same .py
file, ensure the .json
filename matches your intended filename for the outputted JSON file. This name does not have to match the .csv
filename:
with open('sample.json'...
Ensure the .csv
and .py
files are in the same directory and run:
python3 csvToJson.py
You should now see your JSON file added to the directory.
Ryan Wells: ryanwells.com
Licensed under MIT. Enjoy.