CSV.jl number of lines

,

Did you mean to write reusebuffer instead of resusebuffer (note the extra s in “resuse”)?

Other than that, you may need to set the header keyword, depending on whether or not your dataset has a header with column names or not (there may also be other metadata in front of the header, depending on the CSV). Other than that, it works for me:

julia> function countcsvlines(file)
           n = 0
           for row in CSV.Rows(file; header=false, reusebuffer=true)
               n += 1
           end
           return n
       end
countcsvlines (generic function with 1 method)

julia> countcsvlines("example.csv")
8

julia> readlines("example.csv")
8-element Vector{String}:
 "1,2,3,4"
 "4,5,6,7"
 "1,2,3,4"
 "4,5,6,7"
 "1,2,3,4"
 "4,5,6,7"
 "1,2,3,4"
 "4,5,6,7"