I have the following string - it's not exactly comma separated but has the same effect as a csv dataset:
response = "Date;Amount;Account;User\n2014-12-01;12.01;abcxyz;user1\n2014-12-01;10.09;fine;user2\n\r\n\t\t\r\n"
I tried running the following to parse it:
CSV.parse(response, :col_sep => ";", :row_sep => :auto)
but I get the following error:
CSV::MalformedCSVError: Unquoted fields do not allow \r or \n
Any idea why this would be happening?
I also tried doing a response.gsub!("\t", "") to see if that was the issue, but it didn't seem to help.
:autoas a supported value forrow_sep, but notcol_sep. Because it's picking up this whitespace, it stays there, and you get this error because the fields weren't quoted.row_sepandcol_sepwithout swapping the;and whitespace characters inresponse.