Count the length (number of lines) of a CSV file?

后端 未结 7 1184
野性不改
野性不改 2020-12-31 02:46

I have a form (Rails) which allows me to load a .csv file using the file_field. In the view:

    <% form_for(:upcsv, :html => {:multipa         


        
相关标签:
7条回答
  • 2020-12-31 03:15

    another way to read the number of lines is

    file.readlines.size
    
    0 讨论(0)
提交回复
热议问题