Hello, I am new to Batch scripting and am having trouble doing the following.
I would like to have a batch script that scans a set of batch files and makes a set of replacements to the text data. The replacements involve: commenting out some known lines (using ::), replacing a set of 4 lines another set of 7 lines.
Looking forward to your help!
Batch: Replace Specific Lines In a Txt File
Share
==============================================
@echo off > newfile & setLocal enableDELAYedeXpansion
for /f “tokens=1* delims=[]” %%a in (‘find /n /v “” ^< myfile’) do (
if %%a leq 4 >> newfile echo.%%b
if %%a equ 4 >> newfile type newseven.txt
if %%a geq 9 >> newfile echo.%%b
)
=====================================
Helping others achieve escape felicity
M2