Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Making MS Office compatible files on Linux machines with Perl.

by astaines (Curate)
on Jun 18, 2004 at 00:02 UTC ( #367803=perlquestion: print w/ replies, xml ) Need Help??
astaines has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I want to make structured documents, possibly Excel sheets or Word documents, on a Linux machine. I am generating large numbers, (tens of thousands) of random telephone numbers, using Perl on a Linux machine. I have to generate worksheets, in a specific format, with 14 numbers on each page for use by interviewers.

I can (and am) making these worksheets as Excel sheets on a Win32 machine using Perl (Win32::OLE and it's friends). It occurred to me that it might be possible to make these files on my Linux machine. Not greatly to my surprise, Win32::OLE won't install under Linux. (This isn't a criticism of the dedicated and much appreciated coders who work so hard to make these modules.)

So, two questions :-

  • Is it possible to run the Win32 modules, say under Wine, or some other way?
  • I don't have to use MS Office - I just have to print these things, and share them with MS office users. Can I do something similar with OO and Perl? If so, how?

--
Anthony Staines

Comment on Making MS Office compatible files on Linux machines with Perl.
Re: Making MS Office compatible files on Linux machines with Perl.
by tachyon (Chancellor) on Jun 18, 2004 at 00:11 UTC
      RTF::Document && RTF::Parser && RTF:: in general

      I used RTF::Writer (I think) to do this a while ago. It was, um, not fun; after generating a few documents that wedged NT4/Office2k machines to the point that a hard reset was needed, I ended up generating most of the RTF by hand. It may have changed in the past two years or so since I had to use it, but I'd be careful.

      --
      F o x t r o t U n i f o r m
      Found a typo in this node? /msg me
      % man 3 strfry

        I'm not happy with the design of RTF::Writer, either. It'll take care of header information for you, but it doesn't properly abstract things that should be abstracted (like making a bold paragraph). I shouldn't have to know that '\fs20' is a 10-point font. I should be able tell RTF::Writer to put a 20-point font and it'll take care of the details. That's why you have a module to abstract these things. As it is, you end up writing a lot of the RTF by hand, anyway.

        ----
        send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

Re: Making MS Office compatible files on Linux machines with Perl.
by PodMaster (Abbot) on Jun 18, 2004 at 00:12 UTC
    Is it possible to run the Win32 modules, say under Wine, or some other way?
    Wine would be windows, so you'd have to run a windows perl.  

    I don't have to use MS Office - I just have to print these things, and share them with MS office users. Can I do something similar with OO and Perl? If so, how?
    Use the CPAN (OpenOffice::OODoc::Intro)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Making MS Office compatible files on Linux machines with Perl.
by jZed (Prior) on Jun 18, 2004 at 01:59 UTC
    In addition to the other suggestions, you might consider simply creating CSV files on the Linux side. Excell can read them and keep their structure.
Re: Making MS Office compatible files on Linux machines with Perl.
by bibo (Pilgrim) on Jun 18, 2004 at 03:40 UTC
    I'm missing something here. You have a working system using Perl on a Win32 machine. You don't mention it, but I guess it's too slow or too awkward or for some other reason, you want to do it on a Linux box, is that right?

    Well, noone has mentioned the fun and excitement you could possibly enjoy by emitting XML or HTML tables and having Excel import them...Only works on 97 or later, but it's another way to do it. Googling or CPAN should help.

Re: Making MS Office compatible files on Linux machines with Perl.
by jdavidboyd (Friar) on Jul 01, 2004 at 15:06 UTC
    How about adding in some filtering code so that 727-585-xxxx is left out of your list?

    Please?
      You're safe, I'm based in Dublin, Ireland, and working there.
      -- Anthony Staines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-07-11 23:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (236 votes), past polls