Home » Questions » Computers [ Ask a new question ]

Is there a way to append files efficiently using the DOS copy command?

Is there a way to append files efficiently using the DOS copy command?

Using the DOS copy command syntax to concatenate files:

Asked by: Guest | Views: 228
Total answers/comments: 2
Guest [Entry]

"copy is copying file1.txt and file2.txt into memory, concatenating them then writing out to file1.txt. It's not copying to a new file then renaming that file so really there's not much extra disk I/O.

You can also use type.

type file2.txt >> file1.txt

The >> operator appends text. But that will, of course, not work for binary files."
Guest [Entry]

"If they are of the same extension you could do this -

type *.txt >> fileout.tmp.

Then rename fileout.tmp to the proper extension."