Solved

format an ods document

Posted on 2013-10-26
11
617 Views
Last Modified: 2013-10-28
I use ubuntu 13.04 if that's important.
 
I have an ordered by author list of my kindle books.  I saved the file as csv and ods. I used vim and looked at the 2 files.  I can read and understand the csv.  The ods is unreadable because of the formatting characters I guess.  I did this so I could write a program to switch between:
1) white text on a black background
2) black text on a white background
when the author changed.  I was hoping to write a program that reads the csv file and writes the ods file.  Is this method in the ballpark or should I try to write a macro in libreoffice calc?    Or something entirely different?  I include the csv file just for completeness.
listofbooks.csv
0
Comment
Question by:dwcronin
  • 4
  • 4
  • 3
11 Comments
 
LVL 28

Accepted Solution

by:
FishMonger earned 500 total points
ID: 39602724
If you want to do this with perl, then you can use the Spreadsheet::WriteExcel module to create the ods spreadsheet.

Examples - Spreadsheet::WriteExcel example programs.

It's not required, but you'll also want to use the Text::CSV module to parse the csv file.
0
 

Author Comment

by:dwcronin
ID: 39602760
You mentioned Excel.  I'm  using Ubuntu with libreoffice calc.  I'm happy to learn Perl code but I don't want to put 7 back on my system.  Is any of this related to LO calc?
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 39602773
Don't let the "Excel" portion of the module name scare you off.

The module creates a cross platform spreadsheet which can be read by OpenOffice or Excel on either Windows or Linux systems.

I have one script that was written and tested on Windows and then moved to a Linux (Fedora) server when put into production.
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 39602781
Taken from the module's documentation.

The Spreadsheet::WriteExcel Perl module can be used to create a cross-platform Excel binary file. Multiple worksheets can be added to a workbook and formatting can be applied to cells. Text, numbers, formulas, hyperlinks, images and charts can be written to the cells.

The file produced by this module is compatible with Excel 97, 2000, 2002, 2003 and 2007.

The module will work on the majority of Windows, UNIX and Mac platforms. Generated files are also compatible with the Linux/UNIX spreadsheet applications Gnumeric and OpenOffice.org.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39602786
The ods is unreadable because of the formatting characters I guess.  
It's unreadable as it's a compressed binary file

You could use the Uno api to do this
http://api.libreoffice.org/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:CEHJ
ID: 39602904
In future, dwcronin, if you're going to post in a TA, please don't ignore the comments made in that TA
0
 

Author Comment

by:dwcronin
ID: 39604340
CEHJ:  I apologize for doing that.  In all honesty, what did I do wrong.  I don't know what a TA is.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39604419
Well you deliberately included the question in the Java topic area (TA) and then ignored the answer from that area
0
 

Author Comment

by:dwcronin
ID: 39605368
CEHJ: I'm sorry but someone in the Perl TA had already answered my question.  I cannot tell which TA expert will be able to answer my question first but I do know the TA areas that are relevant to my question and I stand any chance of understanding.  I put  lots of effort into trying to understand your answers and I regret if while I  am trying to understand one person's answer that you are still working on the question.  The only way that I could fix this would be if I only placed my question in one TA.  Then I question why you give me 3 TAs that I can put my question into.  EE also requests that I respond quickly to your answers.  I try to assign points as soon as I read an answer I like and again, I'm sorry if you're still working on it.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39605441
I'm sorry if you're still working on it.
If you're saying that you didn't see my answer then that's a little different. I would suggest though that you try to have a final read through of the answers posted before you close the question
0
 

Author Comment

by:dwcronin
ID: 39605980
Thanks.  I closed the question yesterday or the day before.  I will definitely go back and read/try the other solutions.  I was very excited to see the Perl solution.  I thought that my desire to write ods files was impossible.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 98
jar file executable 12 37
VBSCRIPT string remove all characters to the right after extension 4 53
java jdbc batch example 8 17
This is an explanation of a simple data model to help parse a JSON feed
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now