This thread has been idle for some time but since I found a solution, I'm posting.

It looks like a complete answer to my question was published in Linux Journal in September 2005 (<http://www.linuxjournal.com/article/8550>) and October 2005 (<http://www.linuxjournal.com/article/8608>).

I thank those who responded to my original post. In particular I thank Don Daugherty for the work he put in off list on my behalf. Being a retired programmer this is what I was looking for. Don's approach of patching NoteTab to OpenOffice.org Calc was also intriguing and it is probably better for a non-programmer.

I now consider this topic closed.

--On Thursday, September 03, 2009 06:58:40 PM -0700 "James E. Lang" <[email protected]> wrote:

          Not for the faint of heart!

I have seen no related discussions and this could very well be off topic for
this list so feel free to direct me to a more appropriate list where I will
gladly post the remainder of this message.

I have a five sheet spreadsheet. The contents of the first (1st) and second
(2nd) of the sheets are neither used nor changed in any manner in this task.

I receive a text file as an attachment to an e-mail at least once a week. The
text file contains updated integer and date information for the third (3rd)
and fifth (5th) sheets. I can rather easily fully automate everything that
does not directly involve the spreadsheet. My problem is how to get calc to
automatically accept input data, perform the spreadsheet update, print the
defined print ranges in the third (3rd) and fourth (4th) sheets, and save the
updated spreadsheet. There is data to be printed from both the 3rd and 4th
sheets that is calculated using the updated information.

I figure that if decompression and compression are involved that I will need
to write a program to apply changes to one of the internal files
(content.xml). I think I'm capable of this but want information about land
mines that I may encounter.

I am currently running OpenOffice.org v3.0.1 (build 9379) on Kubuntu 9.04. I
was thinking about making use of "xmllint --format" to produce a copy of
content.xml that could be more readily manipulated and incorporating libxml2
in my program.

It will obviously be a lot better if I can simply invoke calc with an
argument for the .ods file and one for a file that contains data extracted
from the text file of updates and instructions for what calc should do with
the updates including printing pre-defined print ranges from two of the
sheets and exiting from calc after saving (or saving as ...) the updated file.

If I have to use the alternative method (i.e. decompress the .ods file,
format and edit internal file content.xml, and compress the file once again)
then what restrictions apply? My first stab at simply decompressing the file
and compressing it again with a different filename (logically equivalent to
opening the file in calc and saving it as a different filename) was
subsequently rejected by calc which claimed that the file had been corrupted.
I did notice that some empty internal subdirectories from the original file
are not present in the new file. I also noticed that the compression method
(COPY vs DEFLATE) is not the same for a couple of the internal files and that
the compressed size (44 bytes vs 46 bytes) differs in at least one other case.

--
Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to