Question

Is there a way to concatenate two OpenDocument Text documents (i.e. the format OpenOffice uses) in Linux from the command line? I'm looking for a command that will allow me to do something like:

concat-docs doc1.odt doc2.odt doc3.odt -o alldocs.odt

This hypothetical command would produce alldocs.odt, which would contain doc1, doc2, and doc3, one after the other.

I've already looked into doing this at the raw xml level, and it's rather complicated enough (renaming automatic styles to avoid conflicts etc.) that I'd prefer not to do it unless there aren't any other tools that will do what I want.

Was it helpful?

Solution

I am not able to double check right now, but you may want to check out some of the options available from the Python-UNO bridge or OOoPy. Both have utilities that sound like what you might want to do. Python-UNO bridge has something called oomerge.py that is described as "A command line tool, that creates a new document by appending multiple single documents", and OOoPy has a utility that is ooo_cat which is "for concatenating several OOo files into one".

Try these and post back with your findings....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top