How to get the row index of a csv file using ```for row in CSV.File(filename)```?

Hi, I plan to read a .csv file using for row in CSV.File(filename) like the following:

for row in CSV.File(filename) 
      # parse the information stored in this row to a vector of my defined type
end

Now, I need to know the row index. Is there a simple way to get the row index from this setting?
Thank you.

for (i, row) in enumerate(…)

2 Likes

@dpsanders, you mean

for (i,row) in enumerate(CSV.File(filename))

?

1 Like