Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File writing

Status
Not open for further replies.

sarahnice

Technical User
Nov 18, 2002
101
IE
Hi,

I need to write a batch file that will open a text file and append text to the end of it. I can't seem to get it working though. The file name will always be static.

Any help would be greatly appreciated.

Tanx.
 
to add to the file a.txt one line:
echo hello there>>a.txt

To add text from a file test2.txt:
type test2.txt>>a.txt
 
I don't know of a way to open a file and add text to it
in a batch file but you can append stuff.

open "my.bat" for output as #1
print #1,"@echo off"
print #1,"copy file.txt + new.txt File.txt /y"
close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top