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 said:
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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top