I have an excel spreadsheet with 2 columns A and B and the rows of each column 1-10 are numbers. When I try to display the number values. The result is the following:
#<Spreadsheet::Column:0x007fba83810368>
#<Spreadsheet::Column:0x007fba83810d90>
...
...
...
Inside the spreadsheet I have this:
x y
32 4
402 6
733 4
1 30
2 3128
2 4
1 1
6 2
10 63
90 333
This is how I am iterating through the file:
require 'spreadsheet'
importing = Spreadsheet.open 'file.xls'
book = importing.worksheet 'Sheet1'
book.each do |x, y|
x = book.column(1)
y = book.column(2)
puts x
puts y
end
How do I make the ruby program output the data in a formatted way? My expected output is the same as the spreadsheet format.