I want to know stories lines I have in a csv file with a tab delimiter. I try the following in a file countRowsCSV.py
:
import csv
with open('archivo.csv',"r") as f:
reader = csv.reader(f,delimiter = "\t")
data = list(reader)
row_count = len(data)
print row_count
But I answered the terminal:
$ python countRowsCSV.py
Traceback (most recent call last):
File "countRowsCSV.py", line 7, in <module>
data = list(reader)
_csv.Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?