Rails FasterCSV “unquoted fields do not allow \\r or \\n”

旧巷老猫 提交于 2019-11-29 07:39:35

It was as simple as clearing all the formatting off in the csv. Excel seems to have a habit of retaining a lot of the formatting after saving in a csv file, which was causing the failure. After I copied and pasted all the data with no formatting in a new csv file, it was fine.

Use String.encode(universal_newline: true) instead gsub. It converting CRLF and CR to LF # Always break lines with \n

Nick Schwaderer

I do not have enough reputation to comment, but I wanted to say that I have been looking this error across the web day and night for a long time and finally found the solution in the comments, by mu is too short.

I finally got it to work when I put quotes around all of my values.

EDIT: Link to answer!!! Rails FasterCSV "unquoted fields do not allow \r or \n"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!