I have this csv structure
"CATEGORY";"NAME";"AGE"
"Red";"John";"34"
When I import the file through smarter_csv gem I get this hash
{:"\"CATEGORY\""=>"\"Red\"", :"\"NAME\""=>"\"John\"", :"\"AGE\""=>"\"34\""}
The code I use is the following
options = {:col_sep => ";",:row_sep => :auto, :quote_char => "\x00"}
SmarterCSV.process(save_folder, options) do |array|
Item.create(array.first)
end
What puzzles me is the \" that is added in each item of the hash. I have used this same method before without issues and I don't understand what is going wrong, but the expected hash should be plan text with no backslash and additional quotes. As a note, is I don't use the ";quote_char => "\x00"" option I get a malformed csv error.