Write list to new column in existent csv

Peter Otten __peter__ at web.de
Fri Oct 17 20:08:42 CEST 2014

Tal Bar-Or wrote:

> I am tryin to figure how to write a list i have as follows

> To a a csv to for example the 3rd column , i am really got stacked here i
> tried few codes with csv.writerow() but didn't got it work ,will really
> appreciate if someone could help me with that Please advice Thanks

Here's a sketch:

Open the source file using a csv.reader(); open the destination file using a 

Use zip() and a for-loop to iterate over the new column and the rows in the 

Insert the new field into the source row, e. g. row.insert(3, field)

Use writerow() to write the modified row.

More information about the Python-list mailing list