简体   繁体   中英

roo gem in Ruby

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...

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

http://roo.rubyforge.org/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM