append a text file to a text file in a .bat

September 10, 2010 at 13:51:30
Specs: Windows 7
We need to know how to append a text file to a text file in a .bat file. We need to add data to an existing file through a batch file that we are exporting to another program.

See More: append a text file to a text file in a .bat

Report •


#1
September 10, 2010 at 14:06:50
copy file a + file b file c

Why did it take me over a year to phone in a problem to ATT?


Report •

#2
September 10, 2010 at 14:30:34
First method

copy /A File_A + File_B File_C /B

Jefro's solution adds an End Of File character 1Ah that may cause trouble.

Another way is

type File_B >> File_A

the above code just appends File_B to File_A without generating a new file (File_C).


Report •

#3
September 10, 2010 at 20:23:57
download coreutils for windows then do this

c:\test> cat fileA >> fileB

if you want to append multiple files
cat file* >> fileZ

GNU win32 packages | Gawk


Report •

Related Solutions

#4
September 13, 2010 at 12:22:28
Your suggestion worked but we need to have the new info start on a new line. As of now the info is there but starts at the end of the last line. Any ideas?

Report •

#5
September 13, 2010 at 12:53:03

echo.>> File_A
Type File_B >> File_A

or alternate method

echo.>> File_A
copy /A File_A + File_B File_C /B


Report •

#6
September 13, 2010 at 13:07:39
Thank you so much. That worked.

Report •

Ask Question