title: Add a column in a tab delimited text file in python
body: <p>What's the easiest way to open a file, read a line, append to just that line and then close the file.</p>
  
  <pre><code> with open(infile, 'w') as inf: 
        for line in inf:
            line = line.join(x)
  </code></pre>
  
  <p>But how to change/add to the the code so that I can add to the line in infile, or replace the line in infile without effecting the rest of the document? </p>
  
  <p>I have been writing new files and deleting the old ones when done but this doesn't seem like very clever strategy. I would like to do this without using the csv module as I want to keep everything as simple text files.</p>