How to convert a large Json file into a csv using python
<p>(Python 3.5)
I am trying to parse a large user review.json file (1.3gb) into python and convert to a .csv file. I have tried looking for a simple converter tool online, most of which accept a file size maximum of 1Mb or are super expensive.
 as i am fairly new to python i guess i ask 2 questions.</p>

<ol>
<li><p>is it even possible/ efficient to do so or should i be looking for another method?</p></li>
<li><p>I tried the following code, it only is reading the and writing the top 342 lines in my .json doc then returning an error.</p></li>
</ol>

<blockquote>
  <p>Blockquote 
    File "C:\Anaconda3\lib\json__init__.py", line 319, in loads
      return _default_decoder.decode(s)</p>
</blockquote>

<p>File "C:\Anaconda3\lib\json\decoder.py", line 342, in decode
    raise JSONDecodeError("Extra data", s, end) 
JSONDecodeError: Extra data</p>

<p><strong>This is the code im using</strong></p>

<pre><code>import csv
import json

infile = open("myfile.json","r")
outfile = open ("myfile.csv","w")

writer = csv.writer(outfile)

for row in json.loads(infile.read()):
  writer.writerow(row)
</code></pre>

<p><strong>my .json example:</strong></p>

<p>Link To small part of <a href="http://pastebin.com/mfHr703f" rel="nofollow">Json</a></p>

<p>My thoughts is its some type of error related to my for loop, with json.loads... but i do not know enough about it. Is it possible to create a dictionary{} and take convert just the values "user_id", "stars", "text"? or am i dreaming.</p>

<p>Any suggestions or criticism are appreciated.</p>

<p>Sometimes it's not as easy as having one JSON definition per line of input. A JSON definition can spread out over multiple lines, and it's not necessarily easy to determine which are the start and end braces reading line by line (for example, if there are strings containing braces, or nested structures). </p>

<p>The answer is to use the <code>raw_decode</code> method of <code>json.JSONDecoder</code> to fetch the JSON definitions from the file one at a time. This will work for any set of concatenated valid JSON definitions. It's further described in my answer here: <a href="http://stackoverflow.com/questions/36019907/importing-wrongly-concatenated-jsons-in-python/36021001#36021001">Importing wrongly concatenated JSONs in python</a></p>

python json csv dictionary