i have csv file with strange format
2783¦Larson and Sons
967¦Becker Group
333¦Rolfson LLC
I have tried to do this
CSV.foreach("#{Rails.root}/csv_files/suppliers.csv") do |supplier|
p supplier[0]
end
but have got a string "2783¦Larson and Sons"
How to separate values? For example will return
supplier[0] #=> "2783"
supplier[1] #=> "Larson and Sons"
CSV.for_each(filename, col_sep: '¦') do .... SeeCSV.newfor available options.