The Spreadsheet Library is designed to read and write Spreadsheet Documents. As of version 0.6.0, only Microsoft Excel compatible spreadsheets are supported.
require 'spreadsheet' book = Spreadsheet.open '/path/to/an/excel-file.xls' sheet = book.worksheet 0 sheet.each do |row| puts row[0] end
VERSION | = | '0.6.4.1' | The version of Spreadsheet you are using. |
client_encoding | [RW] |
Parses a Spreadsheet Document and returns a Workbook object. At present, only Excel-Documents can be read.
# File lib/spreadsheet.rb, line 60 60: def open io_or_path, mode="rb+", &block 61: if io_or_path.respond_to? :seek 62: Excel::Workbook.open(io_or_path) 63: elsif block 64: File.open(io_or_path, mode) do |fh| 65: block.call open(fh) 66: end 67: else 68: open File.open(io_or_path, mode) 69: end 70: end