I am using roo to read an xlsx file.
book = Roo::Spreadsheet.open("codes.xlsx")
sheet = book.sheet('Sheet1')
This reads all the rows in the file.
I can iterate through this sheet using
plans_sheet.each(column_1: 'column_1', column_2: 'column_2') do |hash|
But this iteration happens from the first row which has all the column names as well. I need to take only the second row data.
Update - when you do row(2) it returns you an array. And when you are iterating using .each it returns you a hash which has column names as your key .
How to do that.
Just do
It is always good to have a look at the documentation, it is explained in the README.md of the Gem, see https://github.com/roo-rb/roo#accessing-rows-and-columns