|Hi all! I'm new here and I need a little help with my batch script.|
Here's an example of what I want to do:
If a text file contains "myword", the script rewrites the file into a new one adding a line "mytexthere" under the line where it found "myword".
The original file:
The new file:
I found this so far:
@echo off > codes2.cfg & setLocal enableDELAYedexpansion
for /f "tokens=* delims= " %%a in (codes.cfg) do (
echo %%a >> codes2.cfg
if %%a equ myword (
echo mytexthere >> codes2.cfg
But it works only when myword is a whole line.