copy/cat

Oct 18, 2008
300
1
Hello --- I always have some very of unix cmd installed on my system. ie mks or cygwin to get access to the "cat" command --- which I would
use to concatenate file content --- is there an tcc command that would do the same thing? Thanks
 
Oct 18, 2008
300
1
Thanks -- would that work with multiple files just conning the input file with + signs?
 
Dec 7, 2009
235
2
Left Coast, USA
I have been able to do this with minimal typing when I've had files in a sequence — for example, when someone has split a large file.

Filename.001
Filename.002


or

Filename-001.bin
Filename-002.bin


and so forth. I know the output is supposed to be, say, a .zip file, and the following has always worked well:

copy /b filename.0?? test.zip

First I use the copy command's "/n" (for "no action — display what WILL happen") switch.

copy /n /b filename.0?? test.zip

I watch for what will happen when I run the command without "/n". If all looks ok I go for it.

Obviously that simple a command line won't do the job if the files aren't named sequentially. Then you'll need to use "+" as shown in the other reply.
 

samintz

Scott Mintz
May 20, 2008
1,409
13
Solon, OH, USA
The plus signs are optional. The COPY command will concatenate all the files up to the last one.
Code:
copy /b file1 file2 file3 file4 file5
That will create file5 as the concatenation of files 1-4. The /b switch forces binary mode. Although I don't know that it matters any more. I think TCC defaults to binary copying.
 

samintz

Scott Mintz
May 20, 2008
1,409
13
Solon, OH, USA
Semi-related to that, you can copy multiple files to a destination directory by separating the files with semicolons.
Code:
copy c:\dir1\dir2\dir3\dir4\file1;file2;file3;file4 C:\dir5\