title: python program - modify columns in text file
body: <p>I need to delete a few columns in textfile, one of them is in the middle, and add two new.
  This is my code. It works apart from the first line. How can I make it work for all lines?</p>
  
  <pre><code>infile = open('a.txt').read()
  list =infile.split( );
  print ("Hello " + list[0]+ "world" + list[2] + " " + list[3]+"313")
  </code></pre>
  
  <p>For example, I have got 5 columns in my original file:</p>
  
  <pre><code>1 2 3 4 5           
  5 2 2 5 2           
  1 2 5 6 2           
  1 2 5 1 2           
  1 5 6 7 8    
  </code></pre>
  
  <p>The output is supposed to look like this:  </p>
  
  <pre><code>1 "yyy" 4 "xxx"
  5 "yyy" 5 "xxx"
  1 "yyy" 6 "xxx"
  1 "yyy" 1 "xxx"
  1 "yyy" 7 "xxx" 
  </code></pre>