Just trying to learn python and trying to help a friend with taking a column from a .csv file to print it with a label-maker. The first problem I came across is this:
I will use this example file: test.csv
1111,2222,3333,4444
aaaa,bbbb,cccc,dddd
aaaa,bbbb,cccc,dddd
I run it trough:
import csv
with open('test.csv', 'r') as csv_File:
csv_reader = csv.reader(csv_File)
with open('test2.csv', 'w') as new_file:
csv_writer = csv.writer(new_file)
for line in csv_reader:
(csv_writer).writerow(line[1])
and get the output:
2,2,2,2
b,b,b,b
b,b,b,b
I want the output:
2222
bbbb
bbbb
what am I doing wrong?