Re: How do you tag one file onto the end of another?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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



.



Relevant Pages

  • Re: How do you tag one file onto the end of another?
    ... However, if filea is huge, this takes a noticeable time, because ... the entirety of filea is copied to filec (followed by fileb, ... will append fileb to filea - but only if it's a text file. ...
    (microsoft.public.windowsxp.newusers)
  • How do you tag one file onto the end of another?
    ... However, if filea is huge, this takes a noticeable time, because the entirety of filea is copied to filec (followed by fileb, obviously). ... you can just append things to another file - e. ...
    (microsoft.public.windowsxp.newusers)
  • Re: How do you tag one file onto the end of another?
    ... However, if filea is huge, this takes a noticeable time, because ... the entirety of filea is copied to filec (followed by fileb, ... you can just append things to ...
    (microsoft.public.windowsxp.newusers)
  • Re: appending file
    ... Kuo a écrit: ... I'm trying to read a file (fileA) and append to another file. ... newline" may be a good start. ...
    (comp.lang.python)
  • Re: VCS systems on linux
    ... So, I have fileA, fileB, fileC at v5. ... After having had to deal with CVS for a few years, I can say that it is ...
    (Debian-User)