inserting a new word into a new line

May 24, 2011 at 17:07:13
Specs: Windows XP
have a bat file with 5 lines :

axxxxxx
axxxxxx
axxxxxx
axxxxxx
axxxxxx

would like to insert bxxxxxx into line three
however not replacing the original. just moving original down a line.
thanx


See More: inserting a new word into a new line

Report •


#1
May 25, 2011 at 01:41:33
:: ==========================================
::
:: 4341524b.bat Wed 25-05-2011 15:32:01.64
@echo off > newfile & setLocal enableDELAYedeXpansioN

set N=
for /f "tokens=* delims= " %%a in (myfile) do (
set /a N+=1
if !N! equ 3 echo.bxxxxxx
echo.%%a
) >> newfile


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
May 25, 2011 at 15:48:14
HI thanx 4 reply noticed the equ 3
is there a way of applying math to this say for every 5 lines.
any advice or links would be much appreciated

Report •
Related Solutions


Ask Question