title: Add new columns to comma delimited text file python
body: <p>I am new to python and facing some problems.
  I have a file with two columns separated by comma having numerical values (sample) -</p>
  
  <pre><code>2306,12017
  2307,9416.6
  2308,7378.5
  2309,5781.4
  </code></pre>
  
  <p>and so on..</p>
  
  <p>I am willing to have an output file somewhat like this -</p>
  
  <pre><code>bfe,2306,hgen,,12017
  bfe,2307,hgen,,9416.6
  bfe,2308,hgen,,7378.5
  bfe,2309,hgen,,5781.4
  </code></pre>
  
  <p>and so on..</p>
  
  <p>thanks in advance.</p>
  
  <p>This is what I have tried so far,</p>
  
  <pre><code>data = open("myFile1.txt", "r").readlines()
  output = ["%s,%s,%s,%s" % ("bfe",item.strip(),"hgen",item.strip()) for item in data]
  f = open("output.txt", "w")
  f.write("\n".join(output))
  f.close()
  </code></pre>