I have a following csv:
"id","title"
1070,"\"stern\" Abo"
1071,"stern_de"
To read only the first column I can do following:
CSV.foreach(a, :headers => true, :quote_char => "'") do |row| b.push(row[0]) end
However, I want to address the column rather by column name than by index.
The above command return me an array b
filled with nils.
CSV.foreach(a, :headers => true, :quote_char => "'") do |row| b.push(row['title']) end