Can ruby-spreadsheet read\write open office ods files?

there are two files :/home/pt/test/codetable.xls
,/home/pt/test/codetable.ods
the program1 can run:
require 'rubygems'
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
xls = Spreadsheet.open '/home/pt/test/codetable.xls'
sheet = xls.worksheet 0
sheet.each do |row|
  puts row
end
but program2 can't run:
require 'rubygems'
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
xls = Spreadsheet.open '/home/pt/test/codetable.ods'
sheet = xls.worksheet 0
sheet.each do |row|
  puts row
end

can ruby-spreadsheet read\write open office ods files?

···

--
Posted via http://www.ruby-forum.com/.

According to homepage of spreadsheet gem (http://spreadsheet.rubyforge.org/\)
, it's compatible with Microsoft Excel only.

···

On 18 May 2010 12:22, Pen Ttt <myocean135@yahoo.cn> wrote:

there are two files :/home/pt/test/codetable.xls
,/home/pt/test/codetable.ods
the program1 can run:
require 'rubygems'
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
xls = Spreadsheet.open '/home/pt/test/codetable.xls'
sheet = xls.worksheet 0
sheet.each do |row|
puts row
end
but program2 can't run:
require 'rubygems'
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
xls = Spreadsheet.open '/home/pt/test/codetable.ods'
sheet = xls.worksheet 0
sheet.each do |row|
puts row
end

can ruby-spreadsheet read\write open office ods files?
--
Posted via http://www.ruby-forum.com/\.

--
A transistor protected by fast acting fuse will protect the fuse by blowing
first

It seems to only support Excel. However, roo might work:

http://roo.rubyforge.org/

According to that page:

This gem allows you to access the content of

Open-office spreadsheets (.ods)
Excel spreadsheets (.xls)
Google (online) spreadsheets
Excel’s new file format .xlsx

···

On Tuesday, May 18, 2010 01:52:32 am Pen Ttt wrote:

can ruby-spreadsheet read\write open office ods files?