title: How to jump to a particular line in a huge text file?
body: <p>Are there any alternatives to the code below:</p>
  
  <pre><code>startFromLine = 141978 # or whatever line I need to jump to
  
  urlsfile = open(filename, "rb", 0)
  
  linesCounter = 1
  
  for line in urlsfile:
      if linesCounter &gt; startFromLine:
          DoSomethingWithThisLine(line)
  
      linesCounter += 1
  </code></pre>
  
  <p>If I'm processing a huge text file <code>(~15MB)</code> with lines of unknown but different length, and need to jump to a particular line which number I know in advance? I feel bad by processing them one by one when I know I could ignore at least first half of the file. Looking for more elegant solution if there is any.</p>