On Thu, Jun 14, 2018 at 4:09 PM, fugee ohu <
fuge...@gmail.com> wrote:
> csv files have their commas pre-escaped so i don't have to worry about there
> being commas in data, i can just use the split function to read in?
Maybe.
-----------------------------------------------------------------------------------------
require 'csv'
csv_string = CSV.generate do |csv|
csv << ['dog', 'barking\, all night', 'woof\n']
csv << ['cat', 'meowing incessantly', 'meow\n']
end
csv_string.split("\n").each { |line| puts("# of fields:
#{line.split(',').length}\n") }
-----------------------------------------------------------------------------------------
Maybe not. 😀
--
Hassan Schroeder ------------------------
hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote