开发者

Error parsing CSV with FasterCSV gem (MalformedCSVError)

开发者 https://www.devze.com 2023-03-25 20:13 出处:网络
FasterCSV is raising MalformedCSVError (Illegal Quoting) in this line: 0150|1161623|Medicamentos e genericos \"EPP\".|1423|PB|

FasterCSV is raising MalformedCSVError (Illegal Quoting) in this line:

|0150|1161623|Medicamentos e genericos "EPP".|1423|PB|

This is the code:

FasterCSV.foreach(path_to_file, :col_sep => '|') do |row|
    ...
end

Any id开发者_开发技巧eas? tks!!


There is also an option quote_char which defaults to ", try changing it to something, which you don't expect in your data. You might try nil but I have never tried that.

FasterCSV.foreach(path_to_file, :col_sep => '|', :quote_char => "|") do |row|
  ...
end
0

精彩评论

暂无评论...
验证码 换一张
取 消