CSV - Unquoted fields do not allow \r or \n (line 2)

后端 未结 8 1356
耶瑟儿~
耶瑟儿~ 2020-12-28 15:38

Trying to parse a CSV file, but still getting the error message Unquoted fields do not allow \\r or \\n (line 2)..

I found here at SO similar topic,

8条回答
  •  滥情空心
    2020-12-28 16:27

    In my case, the first row of the spreadsheet/CSV was a double-quoted bit of introduction text. The error I got was: /Users/.../.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/csv.rb:1880:in `block (2 levels) in shift': Unquoted fields do not allow \r or \n (line 1). (CSV::MalformedCSVError)

    I deleted the comment with " characters so the .csv ONLY had the .csv data, saved it, and my program worked with no errors.

提交回复
热议问题