title: Effective way to get part of string until token
body: <p>I'm parsing a very big csv (big = tens of gigabytes) file in python and I need only the value of the first column of every line. I wrote this code, wondering if there is a better way to do it:</p>
  
  <pre><code>delimiter = ','
  f = open('big.csv','r')
  for line in f:
      pos = line.find(delimiter)
      id = int(line[0:pos])
  </code></pre>
  
  <p>Is there a more effective way to get the part of the string before the first delimiter?</p>
  
  <p><strong>Edit:</strong> I do know about the CSV module (and I have used it occasionally), but I do not need to load in memory every line of this file - I need the first column. So lets focus on string parsing.</p>