I want to have the number of rows for some CSV files.
I have found that can be easily done with len&list functions.
reader = csv.reader(base_data, delimiter=',', quoting=csv.QUOTE_MINIMAL, lineterminator="\n"
total_line = len(list(reader))
The problem is that after have the information about the number of row of the csv file, I would like to iterate on the reader object
for line in reader:
id_revision = line[0]
...
Without the len&list function the iteration works, but when I calculate the number of row the iteration doesn't even begin.(Process finish without error)
data = list(reader) total_line = len(data) for line in data:....<\code> With this code works.
– Domenico Antonio Tropeano Jun 12 '19 at 10:29