Ask Your Question
0

How can I concatenate multiple docx files

asked 2016-12-20 00:14:06 +0100

rich12345 gravatar image

Hi. After struggling with this for a couple days, time to ask for help.

I run Linux Mint 18. I have a folder full of documents that I can edit fine in LibreOffice 5 with a .docx extension. I wish to concatenate these together. LibreOffice provides no way to combine these other than one at a time, manually. I went to the command line and used the following command:

cat file1.docx file2.docx >> new.docx.

Shockingly, this does NOT work. It is clear from the size of the resultant file that all the input files are there. However, I can only see one of them (the last one, I think) when I edit it in LibreOffice. I suppose I am naive to think this should work. I have searched the internet for an alternative. I find nothing (that I can understand). Is there another way to combine these files?

Thanks.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2016-12-20 08:32:28 +0100

ajlittoz gravatar image

cat cannot work because word processor files are not plain text. They contain a lot of housekeeping data (think of it like a dictionary or a small database).

Have you tried setting up a master document?

A master document "includes" other documents based on file names. You just describe which one you want in the master. They stay independent from the master (meaning they are not physically merged into the master, there is only a "pointer").

You are encouraged to read the Writer manual.

Note:

You may stumble on little difficulties with master/slave documents. To decrease this risk, switch to .odt native format for included files.

If this is the answer you're looking for, please accept it by clicking on the check mark at left.

edit flag offensive delete link more

Comments

After you have created the master document by adding all the files to it, you can export the master as one file.

File > Export

LibreTraining gravatar imageLibreTraining ( 2016-12-20 21:12:52 +0100 )edit
0

answered 2017-02-05 22:15:57 +0100

rich12345 gravatar image

updated 2017-03-30 17:37:04 +0100

I initially rejected a master document out of hand - not because I am familiar with it but because my final goal is to create a single document that I can import into a different application. The last comment added, however, seems to imply I can do this, so I will give it a try next time I have to do it.

30Mar2017: Took me a while to check this out. As a test, I took several stand alone .odt documents and combined them together as a master document. Then, I exported the result to another stand alone .odt document. Seemed to work well. I intend to use this technique going forward.

edit flag offensive delete link more

Comments

Including the docs in a master doc can be done by selecting multiple docs at once.
Once you export to ODT file you can break the links to the sub-docs and truly have one doc.
Click somewhere not in a sub-doc and then go into links and delete the links to the sub-docs.
Now you have one doc.

LibreTraining gravatar imageLibreTraining ( 2017-03-30 17:52:36 +0100 )edit
0

answered 2017-02-05 22:54:13 +0100

floris v gravatar image

You can simply use Insert - Document one at a time to get them all in. You can't multiselect to select all files at once, or rather that didn't work for me.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-12-20 00:14:06 +0100

Seen: 2,884 times

Last updated: Mar 30 '17