copy/cat

Oct 18, 2008
349
2
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
349
2
Thanks -- would that work with multiple files just conning the input file with + signs?
 
Dec 7, 2009
238
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,557
26
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,557
26
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\
 
May 20, 2008
12,178
133
Syracuse, NY, USA
Actually, by a system configured list separator.
Which only happens to be a semicolon in majority of locales.
Isn't it a TCC-specific "include list" and don't include lists always use the semicolon?
An include list is simply a group of filenames, with or without wildcards, separated by semicolons [;].
 

Similar threads

Replies
7
Views
2K