Here is my code so far:
import csv
reader = csv.reader(open('new_file.txt','r'),delimiter=' ')
row1 = reader[0]
row2 = reader[1]
row3 = reader[2]
Here is my new_file.txt
:
this is row one
this is row two
this is row three
When I run It i have the following error:
Traceback (most recent call last):
File "/home/me/Documents/folder/file.py", line 211, in <module>
row1 = reader[0]
TypeError: '_csv.reader' object has no attribute '__getitem__'
How can I fix that?
Thanks.