You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roo is available here and on Rubyforge. You can install the official release with 'gem install roo' or refer to the installation instructions below for the latest development gem.
14
-
15
-
Homepage: http://roo.rubyforge.org/
16
-
17
-
Gemcutter: http://rubygems.org/gems/roo
18
-
19
-
## Installation
20
-
21
-
# Run the following if you haven't done so before:
22
-
gem sources -a http://gems.github.com/
23
-
24
-
# Install the gem:
25
-
sudo gem install roo
26
-
27
-
## Usage:
28
-
29
-
require 'rubygems'
30
-
require 'roo'
31
-
32
-
s = Openoffice.new("myspreadsheet.ods") # creates an Openoffice Spreadsheet instance
33
-
s = Excel.new("myspreadsheet.xls") # creates an Excel Spreadsheet instance
34
-
s = Google.new("myspreadsheetkey_at_google") # creates an Google Spreadsheet instance
35
-
s = Excelx.new("myspreadsheet.xlsx") # creates an Excel Spreadsheet instance for Excel .xlsx files
36
-
37
-
s.default_sheet = s.sheets.first # first sheet in the spreadsheet file will be used
38
-
39
-
# s.sheet is an array which holds the names of the sheets within
40
-
# a spreadsheet.
41
-
# you can also write
42
-
# s.default_sheet = s.sheets[3] or
43
-
# s.default_sheet = 'Sheet 3'
44
-
45
-
s.cell(1,1) # returns the content of the first row/first cell in the sheet
46
-
s.cell('A',1) # same cell
47
-
s.cell(1,'A') # same cell
48
-
s.cell(1,'A',s.sheets[0]) # same cell
49
-
50
-
# almost all methods have an optional argument 'sheet'.
51
-
# If this parameter is omitted, the default_sheet will be used.
52
-
53
-
s.info # prints infos about the spreadsheet file
54
-
55
-
s.first_row # the number of the first row
56
-
s.last_row # the number of the last row
57
-
s.first_column # the number of the first column
58
-
s.last_column # the number of the last column
59
-
60
-
# limited font information is available
61
-
62
-
s.font(1,1).bold?
63
-
s.font(1,1).italic?
64
-
s.font(1,1).underline?
65
-
66
-
67
-
see http://roo.rubyforge.org for a more complete tutorial
0 commit comments