General discussion

Locked

Merge two documents

By doesnotknowitall ·
At the command line, how can I merge/concatenate two files into one new one?

This does not seem to work:
copy file1 + file2 filenew

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Merge two documents

by DKlippert In reply to Merge two documents

What operating system?
It should work:
C>copy File1.txt+File2.txt FileNew.txt

See Windows copy command help below:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

C>copy /?
Copies one or more filesto another location.

COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

source Specifies the file or files to be copied.
/A Indicates an ASCII text file. /B Indicates a binary file.
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/N Uses short filename, if available, when copying a filewith a
non-8dot3 name.
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

Collapse -

Merge two documents

by doesnotknowitall In reply to Merge two documents

I had tried these options but it appears that it was my file type. When I changed it from rich text format to text format, the merge worked.

Collapse -

Merge two documents

by sgt_shultz In reply to Merge two documents

just take out the spaces between the multiple source files...
example:
copy file1+file2 filenew

Collapse -

Merge two documents

by doesnotknowitall In reply to Merge two documents

It works either way.

Collapse -

Merge two documents

by doesnotknowitall In reply to Merge two documents

This question was closed by the author

Collapse -

Merge two documents

by doesnotknowitall In reply to Merge two documents

P.S. Thanks!

Back to Desktop Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums