I want to create a new CSV file with 3 items per row. My source file looks like (there are no new lines / line breaks):
12123, 1324, 232324, 243443, 234, 2345, 2334, 2445, 22355, 222234, 2345
Now I want to transform this file in a CSV file. Take the first three elements and put it in the first row, new line, and take the next three items, etc...
12123, 1324, 232324
24343, 234, 2345
...
How can I do that with Python 3.x? I'm new in Python and don't get it... My previous attempt:
import csv
with open('test.csv') as f:
reader = csv.reader(f)
with open('test2.csv', 'w') as csvfile:
writer = csv.writer(csvfile)
liste = list(reader)
print(liste[1:2])
But my list object has only one long item.