views:

23

answers:

2

Hi All, I am trying to copy the contents of one document and append it to another document through command prompt. It works fine for simple .txt file through the command (copy fileA.txt + fileb.txt). But when I try to copy the contents of a MSWord file to another MSWord file, it does not happen. Though the target file size keeps increasing but without any content. When opened the doc file in notepad, it shows soe unreadable data keeps getting added. Please help.

A: 

You can't simply concatenate MS Word files. They are binary files and concatenation can be made only using MS Word or some APIs. Not from command line

Андрей Костенко
If the files are in RDF format, it would be "easier" to append using some really wild SED and AWK fu.
BryanH
A: 

(These are unix commands; if you're running on Windows, you can use the appropriate equivalent or Cygwin)

For text files: cat file1 >> file2

For binary files or special formats (i.e., word): - write a program to pull the text from one and insert it into the other, preserving formatting, etc.

or

strings file2 >> file3
strings file1 >> file3

file3 now has all the text.

BryanH