I have a CSV file that I'm trying to process with smarter_csv in Ruby. Every field has double quuotes and there are some fields that have double quotes nested within them that are not escaped. I'm using :force_simple_split => true
as suggested in the documentation to fix this situation. However, when I try to process the file every field has escaped quotes within it. What am I doing wrong here?
I'm opening a csv file that was generated from a Windows server that looks something like this...
header1,header2,header3
"field1, There are "nested quotes" here.","field2", "field3"
I open the file with smarter_csv like so...
c = SmarterCSV.process('myfile.csv', force_simple_split: true, file_encoding: "iso-8859-1", row_sep: "\r")
Then I get output like this...
{:header1=>"\"field1, There are \"nested quotes\"",
:header2=>"\"field2\"",
:header3=>"\"field3\""
}