Thanks Timo.
I have used the spreadsheet gem and parseexcel, but I switched to using
win32ole for more advanced options and for full compatibility with
office 2010 formats. I haven't been keeping up to date with their
progress since, it's always worth looking into them. I haven't seen
hyogen or statsample before, I'll have a look.
There are a few reasons I've set out to build my own class(es) for this:
1) To create an API which feels natural for me. My previous scripting
experience is mostly in VBA, so I'm accustomed to using Excel's API and
my own custom functions. I wanted to get as close to this feel as
possible in order to get comfortable learning Ruby. Of course, in the
process I'm picking up on the concepts of OOP, so my approach is
starting to change as well.
2) To work alongside my existing code. This is a side-project to my main
one, which is a sort of web-scraper specifically designed to work with
my company's online database. I have a few other classes which perform
tasks such as automated reporting with advanced criteria, filling in
forms quickly with minimal user input, and just general helper
applications to improve productivity. It seemed only natural to create a
class capable of handling all the data analysis tasks which I had
previously written using standard Array methods.
3) The actual interaction I have with Excel tends to be minimal. I have
a few data dump methods which will take an array or a hash of arrays,
and output a TSV or Excel file automatically. The focus of the gems you
mentioned seems to be more on read-write operations like this, and I was
after something which would let me analyse and restructure large amounts
of data into an ordered summary. The reason I tend to order my
operations as if it were manual Excel interactions is this is how
customers give me their current methodology, and my API makes it easier
for me to translate their approach into code.
4) To learn how to do it myself rather than relying on existing programs
I'd be happy to share my newfound knowledge with you, although I have to
give the credit mostly to Robert. I'd never have made it this far
without his guidance.
Incidentally I wrote a Matrix movie "Digital Rain" effect (which works
via win32ole) while I was trying to work out how to interact with Excel
efficiently. I've attached it in case you're interested.
Attachments:
http://www.ruby-forum.com/attachment/8160/matrix.rbw
···
--
Posted via http://www.ruby-forum.com/.