title: Python - reading, parsing and writing back to a file
body: <p>I am trying to read around 5000 lines of code from a text file then parse and store the parsed values into another text file. </p>
  
  <p>However, I am able to only do this for the first 967 lines (as indicated by the output file, which contains the parsed values of the first 967 lines only).</p>
  
  <p>Here is the simple code i wrote to do this job.</p>
  
  <pre><code>infile = open("Input.txt", "r")
  outfile = open("Output.txt", "w")
  for line in infile.readline():
      temp = infile.readline()
      value = temp.split("&lt;_|_&gt;")
      outfile.write(value[1])
  </code></pre>
  
  <p>How would I go about writing the other 4000-odd values?</p>