title: Move file pointer to line with a known string in Python
body: <p>I'm reading from a data file and I know my data begins after a line that contains '[Data]'.
  I would like to search through the file until it reaches this line and then stops so I can begin to format the data. This is my attempt:</p>
  
  <pre><code>fid='myData.dat'
  f=open(fid,'r')
  fline = 'string'
  while fline != '[Data]':
      fline=f.readline()
      print fline
  </code></pre>
  
  <p>However, it reads through every line in the document without stopping. I know for a fact that the line I want only contains [Data] and no other spaces or characters.
  I'm sure there is a better way of doing this and I am open to going about this in any other way.</p>