Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

copy/cat

Oct
356
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
 
copy /b first_part.fil + last_part.fil concatenate.fil
 
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.
 
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.
 
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\
 
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
Back
Top