title: append content of one csv file to another using python
body: <p>I have 2 csv files:</p>
  
  <ul>
  <li>output.csv</li>
  <li>output1.csv</li>
  </ul>
  
  <p>output.csv has a 5 columns of titles.<br>
  output1.csv has about 40 columns of different types of data.</p>
  
  <p>I need to append all the content of output1.csv to output.csv.  How can I do this?<br>
  could somebody please give me a hint on how to go about it ???<br>
  i have the following code :</p>
  
  <pre><code>reader=csv.DictReader(open("test.csv","r"))
  allrows = list(reader)
  
  keepcols = [c for c in allrows[0] if all(r[c] != '0' for r in allrows)]
  
  print keepcols
  writer=csv.DictWriter(open("output.csv","w"),fieldnames='keepcols',extrasaction='ignore')
  writer.writerows(allrows)
  
      with open("test1.csv","r") as f:
          fields=next(f).split()
          # print(fields)
          allrows=[]
          for line in f:
              line=line.split()
              row=dict(zip(fields,line))
              allrows.append(row)
              # print(row)
          keepcols = [c for c in fields if any(row[c] != '0' for row in allrows)]
          print keepcols
          writer=csv.DictWriter(open("output1.csv","w"),fieldnames=keepcols,extrasaction='ignore')
          writer.writerows(allrows)
  </code></pre>
  
  <p>test.csv generates output.csv<br>
  test1.csv generates output1.csv  </p>
  
  <p>i m trying to see if i can make both files generate my output in the same file..</p>