Created
March 6, 2015 20:48
-
-
Save mmaelzer/c989e7a94251c205799b to your computer and use it in GitHub Desktop.
csv_to_json.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import json | |
import sys | |
jsonfile = open(sys.argv[2], 'w') | |
with open(sys.argv[1]) as csv_file: | |
reader = csv.DictReader(csv_file) | |
for row in reader: | |
json.dump(row, jsonfile) | |
jsonfile.write('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment