Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large number of odt reports in one folder.

How can I merge them into one odt document from the command line?

I have found that this was possible in ooo_cat, but that seems deprecated (or at least I don't know where to start to use it).

Is it possible to merge odt documents from the command line? Does ooo_cat do the trick, if so, how can I install and use it?

share|improve this question
1  
also see ooopy.sourceforge.net :) what python version are you using? ;) – Rinzwind Jun 12 '14 at 12:02
    
@Rinzwind Of course I've read that as well as sourceforge.net/projects/ooopy, but I cannot find easy install and use instructions (also for future reference). – don.joey Jun 12 '14 at 12:06
    
@Rinzwind python 2.7.6 and 3.4.0. – don.joey Jun 12 '14 at 12:06
    
Also I want to avoid conflict between OO and LO. – don.joey Jun 12 '14 at 12:08
    
Try with libreoffice --print-to-file [OUTPUT FILE HERE] *.odt – user224082 Jun 12 '14 at 12:25

I had time to have a go at @Rinzwind's mentioned ooopy - to install it, download the latest version from here, then extract it and run the setup.py as mentioned here - or just run these commands to install the currently latest version 1.11:

wget http://downloads.sourceforge.net/project/ooopy/ooopy/1.11/OOoPy-1.11.tar.gz
tar -xf OOoPy-1.11.tar.gz
cd OOoPy-1.11/
sudo python ./setup.py install

You can then use it like this:

ooo_cat file1.odt file2.odt file3.odt > file123.odt

this may also work:

ooo_cat file1.odt file2.odt file3.odt -o file123.odt

I have only tried it with three ODTs with small amounts of text.

share|improve this answer
    
Ubuntu 14.04 and Python 2.7.6. Gave it a whirl with 25 separate one-page .odt documents, and it went well up until about page 16, where the formatting got all messed up after that. – Andy J Dec 3 '15 at 11:31
    
@Andy - u could report it as a bug, or try merging them in smalls groups (say 5), and then merging those resulting groups. – Wilf Dec 3 '15 at 11:55

I use pdftk

libreoffice --headless --invisible --convert-to pdf *.odt && pdftk *.pdf cat output combined.pdf
share|improve this answer
1  
-1 because this disregards the question requirement. The OP clearly asked on "How to merge odt documents..." and not pdf. – clearkimura Nov 28 '15 at 16:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.