DOS command to combine or merge text files (Users)
In these situations, I take one of two approaches. I don't start by sorting the file using Norton or any other utility (I may not be at a computer where those are even available). The first thing I do is use REM to create a 0-length file with the appropriate (new) name:
REM > NewFile.Ext
If there are only a few files to concatenate, I use FOR at the command line with the COPY "+" (concatenate) feature:
FOR %f IN (1,2,3,...) DO COPY NewFile.Ext+OldFile.00%f
If there are more than a few files to do this to (will require more than one or two FOR commands), I create a batch file to do it. I start by using DIR to get a sorted list of files:
DIR /O /-P > DoIt.Bat
Then, I edit DoIt.Bat with a text editor (preferably a good one with a macro facility) so that it looks something like this:
COPY NewFile.Ext+OldFile.001
COPY NewFile.Ext+OldFile.002
...
Then I run the DoIt.Bat file and then erase it (after verifying that everything worked OK).
This is actually the same basic process I use when I need to do almost anything to a whole bunch of files, not just concatenate them together.
Complete thread:
- DOS command to combine or merge text files - CluelessInSeattl, 26.08.2012, 19:13 (Users)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- DOS command to combine or merge text files - ron, 27.08.2012, 00:32
- DOS command to combine or merge text files - Doug, 27.08.2012, 07:01
- DOS command to combine or merge text files - ron, 27.08.2012, 08:14
- DOS command to combine or merge text files - bretjohn, 27.08.2012, 17:40
- DOS command to combine or merge text files - Rugxulo, 27.08.2012, 20:44
- DOS command to combine or merge text files - Arjay, 27.08.2012, 21:29
- DOS command to combine or merge text files - CluelessInSeattl, 28.08.2012, 18:12
- DOS command to combine or merge text files - Arjay, 28.08.2012, 22:53
- DOS command to combine or merge text files - CluelessInSeattl, 28.08.2012, 18:12
- DOS command to combine or merge text files - Arjay, 27.08.2012, 21:29
- DOS command to combine or merge text files - Rugxulo, 27.08.2012, 20:44
- DOS command to combine or merge text files - Doug, 27.08.2012, 07:01
- DOS command to combine or merge text files - ron, 27.08.2012, 00:32
Mix view