title: How to convert a large JSON file to CSV?
body: <p>I have some very large json files which i need to convert (The largest one is 4 gb). The online tools only support a small size which is not suitable for me.
  So I looked to stackoverflow to look for scripts which may work for me. The found this one:</p>
  
  <pre><code>import csv
  import json
  
  infile = open("some.json","r")
  outfile = open ("myfile1.csv","w")
  
  writer = csv.writer(outfile)
  
  for row in infile:
    data = json.loads(row)
    writer.writerow(data)
  </code></pre>
  
  <p>Here is a link one of my json files: <a href="https://pastebin.com/KwzgTzmP" rel="nofollow noreferrer">https://pastebin.com/KwzgTzmP</a></p>
  
  <p>When I run the file, I am getting the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
  
  File "C:/Users/Piyush/Desktop/2008/runcsv.py", line 11, in &lt;module&gt;
      writer.writerow(data)
  
  _csv.Error: sequence expected
  </code></pre>
  
  <p>Can someone tell me how I can fix. I don't know python very well so I would appreciate if you give me a detailed answer. </p>