title: python read file from current line
body: <p>I have one problem regarding using python to process the trace file (it contains billion lines of data).</p>
  
  <p>What I want to do is, the program will find one specific line in the file (say it is line# x), and it needs to find another symbol from this (line# x) in the file. Once it finds the line, starts from (line# x) again to search another one.</p>
  
  <p>What I did now, is as following, but the problem is it always needs to reopen the file and read from the beginning to find the match ones (line # > x, and contain the symbol I want). For one big trace file, it takes too long to processing.</p>
  
  <p>1.</p>
  
  <pre><code>    for line in file.readlines()
        i++ #update the line number
        if i &gt; x:
            if (line.find()):
  </code></pre>
  
  <p>or: </p>
  
  <pre><code>   for i, line in enumerate(open(file)):
        if i &gt; x:
            if ....
  </code></pre>
  
  <p>Anyone can give me one hint on better ideas?</p>
  
  <p>Thanks</p>