Link to home
Start Free TrialLog in
Avatar of dwcronin
dwcroninFlag for United States of America

asked on

can you edit a libreoffice calc sheet with a Perl script

I am trying to learn Perl.  THAT'S the main point of this question that I'm not sure is even possible.  I made a csv list of my libreoffice calc spreadsheet of my kindle books.  I would like to write a Perl script to format my csv list so that LibreOffice calc can open it and it's formatted as follows:

Swap between:
1) white text on a black background
2) black text on a white background
when the author changes.

I COULD do that manually but I want the script because this list changes daily.
listofbooks.csv
Avatar of bigbed
bigbed
Flag of United Kingdom of Great Britain and Northern Ireland image

Have a look at the Text::CSV or Text::CSV_XS perl modules. They're very flexible in terms of handling a variety of input and output formats.
Avatar of dwcronin

ASKER

I typed:
"perldoc -f Text::CSV" and got :"No documentation for perl function `Text::CSV' found"
and
"perldoc -f Text::CSV_XS" and got:"No documentation for perl function `Text::CSV_XS' found"
I'm using ubuntu 13.04.  What now?
Avatar of FishMonger
Those are modules, not functions.  If they are already installed, you can access their doc by removing the -f switch from the command.

i.e., "perldoc Text::CSV"

The docs are also available online.
Text::CSV
Text::CSV_XS
If you need to install the modules, you can use the cpan command line utility.

e.g.,
cpan install Text::CSV
I read about it but didn't know how to get to cpan

Do you think it is possible to edit a libreoffice calc file with a perl script?  I'm guessing no.
ASKER CERTIFIED SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As some extra info, a lot of perl modules are available as Ubuntu packages, installable using the apt-get/aptitude/synaptic commands.
For example, libtext-csv-perl is the Text::CSV module.
These have the advantage of being easier to add/update/remove/trace.
Just a thought.
Have fun and good luck
bigbed: Thanks.  I can see Perl is going to take a good bit of effort.  Good.  I wanted to know regular expressions better.