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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -