tags:

views:

364

answers:

4

Hi,

Is there a way to read Excel 97-2003 files from Ruby?

Background

I'm currently using the Ruby Gem parseexcel -- http://raa.ruby-lang.org/project/parseexcel/ But it is an old port of the perl module. It works fine, but the latest format it parses is Excel 95. And guess what? Excel 2007 will not produce the Excel 95 format.

John McNamara has taken over duties as the maintainer for the Perl Excel parser, see http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.55/lib/Spreadsheet/ParseExcel.pm The current version will parse Excel 95-2003 files. But is there a port to Ruby?

My other thought is to build some Ruby to Perl glue code to enable use of the Perl library itself from Ruby. Eg, see http://stackoverflow.com/questions/451636/whats-the-best-way-to-export-utf8-data-into-excel/620612#620612

(I think it would be much faster to write the glue code than to port the parser.)

Thanks,

Larry

A: 

hey Larry,

I've not tried to parse Excel files before, but I know FasterCSV is a great library for parsing CSV files (which Excel can produce).

zgchurch
+4  A: 

I'm using spreadsheet, give it a shot.

khelll
I'm using spreadsheet for Excel generation and it works great. Haven't had much exposure to the parsing side.
Michael Sepcot
Thanks, that's what I was looking for.
Larry K
I use the same - especially after switching from Windows Server to Ubuntu Server 8)
Reuben Mallaby
A: 

In the case that you are Windows,
you can always use WIN32OLE.

Have a look at http://rubyonwindows.blogspot.com/search/label/excel

sunito
+1  A: 

There is also roo: http://roo.rubyforge.org/

Tom Huras