Add file to other file

  • Thread starter Thread starter Richhall
  • Start date Start date
R

Richhall

Hi

I have a file filea.txt that gets created on workstations. I have a
cmd I want to run that will copy this file to a file (log.txt) on
another drive but add into that file not replace. So similar to a >>
when writing to a file. filea is then deleted on the c:\ of the pc.
Can you tell me how I can add into a file please and not replace it?

i.e copy c:\filea.txt j:\log.txt but not replace add into.

Cheers

Rich
 
Richhall said:
Hi

I have a file filea.txt that gets created on workstations. I have a
cmd I want to run that will copy this file to a file (log.txt) on
another drive but add into that file not replace. So similar to a >>
when writing to a file. filea is then deleted on the c:\ of the pc.
Can you tell me how I can add into a file please and not replace it?

i.e copy c:\filea.txt j:\log.txt but not replace add into.

Cheers

Rich

Try this:
type c:\filea.txt >> j:\log.txt
del c:\filea.txt
 
Richhall said:
Hi

I have a file filea.txt that gets created on workstations. I have a
cmd I want to run that will copy this file to a file (log.txt) on
another drive but add into that file not replace. So similar to a >>
when writing to a file. filea is then deleted on the c:\ of the pc.
Can you tell me how I can add into a file please and not replace it?

i.e copy c:\filea.txt j:\log.txt but not replace add into.

Cheers

Rich

To see how to do this, at the command prompt issue

COPY /?

It provides an explaination of appending files.
 
Richhall said:
Hi

I have a file filea.txt that gets created on workstations. I have a
cmd I want to run that will copy this file to a file (log.txt) on
another drive but add into that file not replace. So similar to a >>
when writing to a file. filea is then deleted on the c:\ of the pc.
Can you tell me how I can add into a file please and not replace it?

i.e copy c:\filea.txt j:\log.txt but not replace add into.

Cheers

Rich
use the dos copy command with the + qualifier for the file to add to
the first file.
At the DOS prompt enter: help copy to see the format and usage.
 
Back
Top