python - How to convert a large JSON file to CSV? -


i have large json files need convert (the largest 1 4 gb). online tools support small size not suitable me. looked stackoverflow scripts may work me. found one:

import csv import json  infile = open("some.json","r") outfile = open ("myfile1.csv","w")  writer = csv.writer(outfile)  row in infile:   data = json.loads(row)   writer.writerow(data) 

here link 1 of json files: https://pastebin.com/kwzgtzmp

when run file, getting following error:

traceback (most recent call last):  file "c:/users/piyush/desktop/2008/runcsv.py", line 11, in <module>     writer.writerow(data)  _csv.error: sequence expected 

can tell me how can fix. don't know python appreciate if give me detailed answer.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -