Re: How do you tag one file onto the end of another?
- From: "Richard" <richard@xxxxxxxxxx>
- Date: Mon, 9 Nov 2009 12:12:52 -0500
"J. P. Gilliver (John)" <G6JPG@xxxxxxxxxxxxxxxxxxx> wrote in message
news:Ta5FQGaKTB5KFwoY@xxxxxxxxxxxxxxxxxxxxxx
I know one way to join files: in a command box,
copy /b filea+fileb filec
. However, if filea is huge, this takes a noticeable time, because
the entirety of filea is copied to filec (followed by fileb,
obviously). I know with text files, you can just append things to
another file - e. g.
dir >> filea
will I think append a directory listing to filea, or
type fileb >> filea
will append fileb to filea - but only if it's a text file.
Anyone know how to concatenate arbitrary files, without involving a
third file?
In message <OaWOX88XKHA.1372@xxxxxxxxxxxxxxxxxxxx>, Richard
<richard@xxxxxxxxxx> writes:
To append fileB to fileA:
copy /b fileA+fileB fileA
FWIW. --Richard
"J. P. Gilliver (John)" <G6JPG@xxxxxxxxxxxxxxxxxxx> wrote in message
H+xAZsK6Nh9KFwI$@soft255.demon.co.uk">news:H+xAZsK6Nh9KFwI$@soft255.demon.co.uk...
Won't that still go through the motions of copying every byte of fileA,
even if it's putting the results back in the same place?
Hi again John,
(Actually, I used such small test files it was too fast to tell. :)
Here's the output of my 2 tests:
C:\>copy /a test1.txt+test2.txt test1.txt
test1.txt
test2.txt
1 file(s) copied.
C:\>type test1.txt
This is test1...
This is test2...
C:\>copy /a test1.txt+test2.txt+test3.txt test1.txt
test1.txt
test2.txt
test3.txt
1 file(s) copied.
C:\>type test1.txt
This is test1...
This is test2...
This is test2...
This is test3...
Note that it says only "1 file(s) copied."
(We need bigger guns... :)
Made a copy of a 120MB exe file as trial1.exe (took more than 2 seconds)
Made a copy of a 5MB exe file as trial2.exe (took less than a second)
C:\>copy /b trial1.exe+trial2.exe trial1.exe
took less than a second to append 5MB to 120MB file to get 125MB
Deleted both trial*.exe files.
Copied 120MB exe file as trial1.exe again
Copied 5MB exe file as trial2.exe again
C:\>copy /b trial2.exe+trial1.exe trial2.exe
took more than 2 seconds to append 120MB file to 5MB file to get 125MB
Deleted both trial*.exe files.
That proves that when appending the small to the large file, the large file
was not re-copied into itself, but the 2nd file was only added on the end.
HTH. (Hope This Helps. :)
--Richard
- - -
Special Veteran's Day Remembrance
http://www.avbtab.org/rc/veterans.htm
.
- References:
- Re: How do you tag one file onto the end of another?
- From: Richard
- Re: How do you tag one file onto the end of another?
- From: J. P. Gilliver (John)
- Re: How do you tag one file onto the end of another?
- Prev by Date: Resizing DOS apps windows under
- Next by Date: Re: My Introduction
- Previous by thread: Re: How do you tag one file onto the end of another?
- Next by thread: image resizer help
- Index(es):
Relevant Pages
|