How to add text in a batch File

April 13, 2009 at 08:26:01
Specs: Windows XP
Hello,

I have a file (test.txt) and I need to add text as "wait" on alternate line on above test.txt file. Please some one help me how to do it in batch file.

Example:
TEST.TXT
Stephen Alex
Vince Richard
Harrison Andrew

If we add "WAIT" text, result should be
RETEST.TXT

Stephen Alex
WAIT
Vince Richard
WAIT
Harrison Andrew
WAIT


Thanks,
jdk981


See More: How to add text in a batch File

Report •


#1
April 15, 2009 at 01:32:08
@echo off > newfile

for /f "tokens=* delims=" %%a in (test.txt) do (
echo %%a >> newfile
echo WAIT >> newfile
)


=====================================
If at first you don't succeed, you're about average.

M2


Report •
Related Solutions


Ask Question