title: Change delimiter on "for each" loops on Strings in python
body: <p>I need to read an input text file in python, by streaming line by line. That means load the text file line by line instead of all at once into memory. But my line delimiters are not whitespaces, they are arbitrary characters.</p>
  
  <p>Here is a method on Stack Overflow for loading files line by line:</p>
  
  <pre><code>with open("log.txt") as infile:
      for line in infile:
          do_something_with(line)
  </code></pre>
  
  <p>The above is perfect, however I need to change the delimiter from whitespaces to a different character.</p>
  
  <p>How can this be done? Thank you.</p>