Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 AndrewIf we add "WAIT" text, result should be
RETEST.TXTStephen Alex
WAIT
Vince Richard
WAIT
Harrison Andrew
WAIT
Thanks,
jdk981

@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

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |