How to merge 2 or 3 documents into one file?

Asked by Sajid

Is there something like a "concatenate" command available? I receive inputs from my group which has to be merged and edited to make my reports. Simple cut & paste will work, but if there is a way to merge the files directly into a single file, it will help.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu bash Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

you can add the contents of one file to the end of another. This works great with text files but I am unsure with formatted documents:

you can use:

copy file1.txt+file2.txt output.txt

will create a concactonated file with file1 above file2 in output.txt

you could also try:

cat file2.txt >> file1.txt

which will add the data in file2.txt to the end of file1.txt.

I suggest you make a backup copy of both so you can experiment.

Revision history for this message
Tom (tom6) said :
#2

Can you help with this problem?

Provide an answer of your own, or ask Sajid for more information if necessary.

To post a message you must log in.