title: Opening a 25GB text file for processing
body: <p>I have a 25GB file I need to process. Here is what I'm currently doing, but it takes an extremely long time to open:</p>
  
  <pre><code>collection_pricing = os.path.join(pricing_directory, 'collection_price')
  with open(collection_pricing, 'r') as f:
      collection_contents = f.readlines()
  
  length_of_file = len(collection_contents)
  
  for num, line in enumerate(collection_contents):
      print '%s / %s' % (num+1, length_of_file)
      cursor.execute(...)
  </code></pre>
  
  <p>How could I improve this?</p>