in reply to Re: Creating Excel Spreadsheet from text data file
in thread Creating Excel Spreadsheet from text data file

I'll have to check out the article in TPJ. I understand that excel can open CSV files. You only have to tell it what the delimiters are and select which fields to import. However, this was an oppurtunity for me to write a usefull program that did something other then print "Hello World\n";, if you know what I mean! I especially find it hard to use perl for windows tasks.

This is really one of my first attempts at using perl to parse a file and do something usefull with the data. I'm looking for suggestions on coding style and general improvements on my code.I'm still learning how to properly use regexes and not sure if Im doing things the best way.

As far as the Win32::OLE module, I have looked at the Activestate documents and seen that faq that show how to control Excel. The documentation still leaves me not exactly sure what OLE is and how to use it properly. For example, how do you know which applications can be controlled using OLE and what methods are available through this OLE control? The documentation gives reference on how to find information to controll Microsoft office apps and Lotus notes but falls silenty on all others.

I looked at your script. Not sure what program needs to be installed for access to the OLE, but it does not work on my system.

Thanks for your response!

zzspectrez

Replies are listed 'Best First'.
RE: RE: Re: Creating Excel Spreadsheet from text data file
by $code or die (Deacon) on Nov 06, 2000 at 23:14 UTC
    I agree with you. It's great to try your hand at things to find other ways of doing everyday tasks. Perl is perfect for this sort of thing

    Have a look at this node for information on the OLE browser. I posted this question because I had a vague idea about what OLE did but didn't know how the browser could help me. In the end, I used I couldn't have written the above code without it. For some reason the OLE browser didn't work on my PC - it turns out that I needed to make a change to the registry. Thanks Zoogie!

    My understanding(from my imagination) of OLE is that most (not all) Win32 apps provide sort of external hooks. You can create an OLE object (it becomes an application server) with one of those applications and access those hooks from your Perl script. So in theory you can do whatever the application itself does (assuming that the author provided all the hooks.)

    I have since written a Win32 script that uses OLE to "access" an Access database and pull out records etc.

    While it's all quite fun, it means that your code isn't very portable though - you can only run it on Win32 (and maybe soon Mac?). So if there is a module out there that does the job I would stick to that.

    UPDATE: I think maybe I put too many '()' in this reply. Maybe it's unreadable. Sorry.