http://www.perlmonks.org?node_id=826792

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

So here's my assignment: I have an existing Perl script that takes a bunch of info dumped from a database and uses LaTeX to turn it into a PDF file. My job is to change this so the info is turned into a Word .docx file (which, for anyone who doesn't know, is a zip archive of a bunch of XML files).

My question is, does anyone know of any readily-available scripts that already do this (or something similar, in part or in whole), so I don't reinvent any wheels unnecessarily? Or, if not, do any of the more experienced folks here (I'm also learning Perl while I work on this) have any suggestions on how to approach this problem? Any constructive feedback you can provide would be helpful!

Thanks!
Kaiti

Replies are listed 'Best First'.
Re: using Perl to generate docx file
by Corion (Patriarch) on Mar 04, 2010 at 19:40 UTC

    It seems there are no DocX modules on CPAN, but if it's "just XML", I would suggest you go the route of creating a template in Word and then use one of the template modules to replace the placeholders in your template with the actual data from the database.

      Thanks! I do have a Word template for the document, so I'll go look at the template modules. :-)

      Yay!

      Kaiti

        Hi Kaiti, I have quite the same thing to do : from a set of data, generate a .docx (or .doc) document as automatically as possible. Did you manage to do that with the Word templates? Cheers, Xavier.
Re: using Perl to generate docx file
by MidLifeXis (Monsignor) on Jul 19, 2011 at 15:23 UTC

    The org-mode project (http://www.orgmode.org/) has an org-odt export module that may provide a similar template.

    --MidLifeXis

      Thanks a lot, I'm now trying to find it on their website!