Last active
March 14, 2019 16:20
-
-
Save sreevardhanreddi/5ff0203e51d963a77e239b70dc3b6ba8 to your computer and use it in GitHub Desktop.
This file contains 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 | |
def csv_to_json_conversion(file_name): | |
json_file_name = 'jsonl__42kod.json' | |
with open(file_name, 'r') as f: | |
r = csv.reader(f) | |
head = next(r) | |
reader = csv.DictReader(f, head) | |
with open(json_file_name, 'a+') as fn: | |
for i in reader: | |
fn.write(json.dumps(i) + '\n') | |
csv_to_json_conversion('42kod.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment