Quiero saber cuentos lineas tengo en un archivo csv con un delimitador tabulación. Intento lo siguiente en un archivo 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
Pero me conteste el 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?