Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
BatMaster
- Posts: 28
- Joined: 22 Dec 2010 12:53
#1
Post
by BatMaster » 02 Jul 2011 17:22
Hello the reaason why i started this topic is because i want to put multiple lines of text into a single document usin a batch file
i know how to put single lines of text into a document
it would be really helpfull ifyou could
but if you cant just tell me
thanks in advance
BatMaster
-
dbenham
- Expert
- Posts: 2461
- Joined: 12 Feb 2011 21:02
- Location: United States (east coast)
#2
Post
by dbenham » 02 Jul 2011 17:47
Use the append redirection (>>). If the file does not exist, it will create it. If it does exist it will append to the end.
example:
Code: Select all
echo line1>>test.txt
echo line2>>test.txt
echo line3>>test.txt
Dave Benham
-
nitt
- Posts: 218
- Joined: 22 Apr 2011 02:43
#3
Post
by nitt » 02 Jul 2011 19:21
dbenham wrote:Use the append redirection (>>). If the file does not exist, it will create it. If it does exist it will append to the end.
example:
Code: Select all
echo line1>>test.txt
echo line2>>test.txt
echo line3>>test.txt
Dave Benham
Or you can use:
Code: Select all
(
echo line1
echo line2
echo line3
)>test.txt
-
BatMaster
- Posts: 28
- Joined: 22 Dec 2010 12:53
#4
Post
by BatMaster » 03 Jul 2011 09:47
Thanks A lot Guys thats really helpful
BatMaster