roo gem in Ruby

948 views Asked by At

I am using 'roo' gem for reading and writing the excel sheets. How can I get the last column of each row in excel sheet using 'roo' gem in Ruby

Please give me some suggestion on this...

2

There are 2 answers

0
rlecaro2 On

http://roo.rubyforge.org/

You can use a for with the method last_column as stated on the link above.

1
covard On

You can do the following:

wb = Roo::Excelx.new 'somepath/somefile.xlsx'

1.upto(wb.last_row) do |row_index|
  last_column = wb.cell(row_index, wb.last_column)
end