1.

Solve : Combining files?

Answer»

I know that two files can be combined or added with:
copy /b file.001 + file/002 outputfile

This is o/k for a couple of file. I have 99 files file.001 to file.099 to COMBINE. Is there a way place the above command in a loop to add them all together?
Thanksyou can do it the hard way. use wildcards
Code: [Select]copy file.0* newfile
copy file.1* anothernewfile
then combine the 2 new files togther again.Sometimes things turn out simple.
My files are about 5Mb each and the total of 99 files turned out to be only 1K, Something is not RIGHT. I tried:
copy /b file.0* newfile

This gives the correct size. I am not sure what the /b switch does, but I hope the file contents is correct.
ThanksQuote from: Frank on June 11, 2009, 05:34:27 AM

Sometimes things turn out simple.
My files are about 5Mb each and the total of 99 files turned out to be only 1K, Something is not right. I tried:
copy /b file.0* newfile

This gives the correct size. I am not sure what the /b switch does, but I hope the file contents is correct.
Thanks
check copy /? for what /b does. also, you can make small files and test them out. then you can see what the final file looks like. That's a good idea. I'll do that.
ThanksCOPY assumes text files, and will terminate at Control Z and anything ELSE which is not a normally printable character.

COPY /B is a BINARY copy, which duplicates every character regardless of whether it is printable.

COPY /B file.0* newfile
That will work, and is a great way to use up empty disc space.
It may however disappoint you, newfile will CONTAIN copies of files in the sequence that they are given by Windows.
If you want the contents of file.001 to be followed by file.002 etc etc you need to control the sequence.

Regards
Alan
@OP, if you can afford to install GNU tools (see my sig), common way to do it in *nix can now be done also on Windows
Code: [Select]c:\test> cat file.0* >> newfile.txt


Discussion

No Comment Found