Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Best way to read excel files?

by tphyahoo (Vicar)
on Apr 27, 2005 at 14:17 UTC ( #451968=perlquestion: print w/replies, xml ) Need Help??

tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way to read in excel files on windows using perl?

I am on a winxp machine, with activestate installed. Since my perl is better than my vba, and I like perl better than vba, but I work with excel a lot, I have done some research on the various ways to deal with excel using perl.

spreadsheet::writeexcel is installed and working nicely. There are lots of little examples included which demo how it works, which I like a lot. But this is mainly for writing excel files.

What about reading excel in? I will be munging in many autogenerated excel click reports from various search engines we're working with. (Some have cvs export but not all, or I would be going with text::xsv, which seems a little easier.)

Unfortunately spreadsheet::parseexcel doesn't seem to have any examples included :( so I couldn't easily verify that everything works, or how well it works. Hoping to get some feedback here!

Cultured Perl: Reading and writing Excel files with Perl claims that on windows

"Win32::OLE is the easiest way to get Excel data right now, although the Spreadsheet::WriteExcel and Spreadsheet::ParseExcel modules are catching up."

Is this still true? (Article is a year old.)

Should I use spreadsheet::parseexcel or is it still too beta?

Replies are listed 'Best First'.
Re: Best way to read excel files?
by dragonchild (Archbishop) on Apr 27, 2005 at 17:15 UTC
    I've used Spreadsheet::ParseExcel on many occasions and found it to be just fine. However, since it's a third-party module and not Excel itself (which is what you're using when you use OLE), it's not going to be as good because of any undocumented features. So, if you have the option, use OLE. If you can't, S::PE is an excellent option.

    The Perfect is the Enemy of the Good.

Re: Best way to read excel files?
by JanneVee (Friar) on Apr 27, 2005 at 15:33 UTC

    My spontaneus reaction is use Win32:OLE because I have found the OLE(really it is the COM IDispatch support), stable and well tested.

    Although please note that I use the Win32::OLE to access databases through ADO(MDAC components). Not parse Excel, so of course in light of this YMMV.

Re: Best way to read excel files?
by sekitan (Beadle) on Apr 27, 2005 at 17:39 UTC
    I also use Win32::OLE for reading excel files. I found the same problems with spreadsheet::parseexcel lacking examples. For writing xls files I use OLE and spreadsheet::writeexcel both for different advantages, but for reading, OLE is my tool of choice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://451968]
Approved by gam3
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-07-07 19:23 GMT
Find Nodes?
    Voting Booth?

    No recent polls found