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: users-unsubscr...@openoffice.org
For additional commands, e-mail: users-h...@openoffice.org

Reply via email to