The "Copy /b" command on cmd

  • Thread starter Thread starter Becquer
  • Start date Start date
B

Becquer

I can merge two files by typing on the cmd(without the [] and the "") :

"copy /b [file1name] + [file2name] [targetfilename]"

Where [file1name] and [file2name] are the name of the two files I want to
merge and [targetfilename] is the result file where i want they to mergre in.

But, how can I "unmerge" the result file into the original files?
 
"Becquer" <Becquer@discussions.microsoft.com> wrote in message
news:8EC4D24C-8F75-4C9C-8A2E-2401A0E4F766@microsoft.com...
>I can merge two files by typing on the cmd(without the [] and the "") :
>
> "copy /b [file1name] + [file2name] [targetfilename]"
>
> Where [file1name] and [file2name] are the name of the two files I want to
> merge and [targetfilename] is the result file where i want they to mergre
> in.
>
> But, how can I "unmerge" the result file into the original files?
>


The two (or more) files are merged seamlessly. Unless you add
a marker (see below), you cannot unmerge them.

echo ================== > marker.txt
copy /b file1.txt + marker.txt + file2.txt file3.txt
 
Becquer wrote:
> I can merge two files by typing on the cmd(without the [] and the "")
> :
>
> "copy /b [file1name] + [file2name] [targetfilename]"
>
> Where [file1name] and [file2name] are the name of the two files I
> want to merge and [targetfilename] is the result file where i want
> they to mergre in.
>
> But, how can I "unmerge" the result file into the original files?


Slight correction: the files are not "merged." They are "concatenated."

The "/b" switch implies the files are binary files, NOT text files, that
they should be copied in their entirety rather than the copy process
quitting at the first end-of-file marker.
 
Hi Becquer,

If I wanted the ability to go back to each separate file, I would make a
copy of each file before concatenating to the target file.

Alan

"Becquer" <Becquer@discussions.microsoft.com> wrote in message
news:8EC4D24C-8F75-4C9C-8A2E-2401A0E4F766@microsoft.com...
>I can merge two files by typing on the cmd(without the [] and the "") :
>
> "copy /b [file1name] + [file2name] [targetfilename]"
>
> Where [file1name] and [file2name] are the name of the two files I want to
> merge and [targetfilename] is the result file where i want they to mergre
> in.
>
> But, how can I "unmerge" the result file into the original files?
>
 
"Becquer" <Becquer@discussions.microsoft.com> wrote in message
news:8EC4D24C-8F75-4C9C-8A2E-2401A0E4F766@microsoft.com...
>I can merge two files by typing on the cmd(without the [] and the "") :
>
> "copy /b [file1name] + [file2name] [targetfilename]"
>
> Where [file1name] and [file2name] are the name of the two files I want to
> merge and [targetfilename] is the result file where i want they to mergre
> in.


As noted, this concatenates, not merges. There can be a difference.

> But, how can I "unmerge" the result file into the original files?


You can't, using these utilities. And the original files still exist.

If you want to split files, use a file split utility. If you want to
reproduce the original sizes, you have to know exactly where the
concatenation occurred and specify that for the split.

HTH
-pk
 
Back
Top