Cell.rb
This content was produced by an LLM and could include errors.
This script uses the Roo gem to open an Excel file. It targets a specific sheet to read cell values, determine the last populated row, and find the last column of data within the workbook.
require 'roo'
#=> true
xlsx = Roo::Excelx.new('input/roo/book.xlsx')
#=> <#Roo::Excelx:2030 @tmpdir @shared @filename @sheet_files @sheet_names @sheets @...
sh1 = xlsx.sheet('mysheet')
#=> <#Roo::Excelx:2030 @tmpdir @shared @filename @sheet_files @sheet_names @sheets @...
sh1.cell(1,1)
#=> "key"
sh1.cell(1,2)
#=> "value"
sh1.last_row
#=> 7
sh1.last_column
#=> 2
Ruby 4.0.3