开发者

Error parsing CSV with FasterCSV gem (MalformedCSVError)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜