Merging text files

authenticate

Senior member
Nov 21, 2000
250
0
0
This sounds very basic but I am looking for a utility to merge a number of text files together to produce one output text file. The output file would be a concatenation of all the input files. I have tried the copy command in MS-DOS like this "copy outputfile+inputfile1" "copy outputfile+inputfile2" ... but it adds an undisplayable byte at the beginning of each input file which I then I have to remove. This takes time as the resulting output file is very large (300Mb).
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
cat. cygwin should have this utility and there may be a windowized version out there somewhere...
 

Woodie

Platinum Member
Mar 27, 2001
2,747
0
0
DOS:
type file#1 > outputfile Note the single >. It will overwrite outputfile
type file#2 >> outputfile double >. Appends to outputfile
type file#3 >> outputfile
...


--Woodie
 

Timothy

Member
Dec 25, 2000
103
0
0
The DOS command line should have been:
copy /b file1+file2+file3 Result

The /b produces a binary copy, meaning an exact byte-for-byte copy.

Tim
 

authenticate

Senior member
Nov 21, 2000
250
0
0
Timothy, thanks but I can't use that format of copy interatively as each successive use overwrites the output file. However, a single use of copy .... specifying multiple input files separated by + does not include the unwanted byte.
Woodie, the type command works a treat even for repeat calls.