here is my problem:
in my csv file, I only have one column and multiple rows containing telephone numbers.
a
1 222
2 333
3 444
4 555
what I want is merge them into one string and separate by comma, eg:
a
1 222,333,444,555
The code I am using right now is:
import csv
b = open('test.csv', 'wb')
a = csv.writer(b)
s = ''
with open ("book2.csv", "rb") as annotate:
for col in annotate:
ann = col.lower().split(",")
s += ann[0] + ','
s = s[:-1] # Remove last comma
a.writerow([s])
b.close()
what I get from this is
a
1 222,
333,
444,
555
All the numbers are in one cell now (good) but they are not on one line (there is /r/n after each telephone number so I think that's why they are not on one line). Thank you in advance!

