how to resume read operation of file using python
<p>I have a file sized 15-16GB containing json objects seperated by new line (<strong>\n</strong>).</p>

<p>I am new to python and reading the file using the following code.</p>

<pre><code>with open(filename,'rb') as file:
  for data in file:  
    dosomething(data)
</code></pre>

<p>If while reading the reading ,my script fails after 5GB, how can I resume my read operation from the last read position and continue from there.</p>

<p>I am trying to do the same by using the file.tell() to get position and move the pointer using the seek() function.</p>

<p>Since this file contains json objects, after seek operation am getting the below error.</p>

<blockquote>
  <p>ValueError: No JSON object could be decoded</p>
</blockquote>

<p>I am assuming that after seek operation the pointer is not getting proper json.</p>

<p>How can I solve this?. Is there any other way to read from last read position in python. </p>