I'm having a bit of trouble understanding how to take data from a CSV file to use elsewhere.
My code currently is only:
CSV.foreach("../../lib/modules/csv.csv") do |row|
# use row here...
def initialize(headers, fields, header_row = false)
end
end
That is all I could really pick up from the documentation of Ruby. There doesn't seem to be any examples of how select a header then take a cell under that header?
Here's a quick mock-up of an example table if I'm not explaining this well enough:
title | description | priority
----------------------------------
story1 | example1 | 6
----------------------------------
story2 | example2 | 7
----------------------------------
story3 | example3 | 8
----------------------------------
How can I get the data to be stored in the string?:
example = column[i]