and235100
asked on
Find a text string, and add some text in the line beneath it, in multiple files
Hi.
I have a folder where I have multiple .ini files. I want to add some text to each file, but beneath a line of text that is present in each file.
i.e.
Text to add - this is some text
File:
some text
some text
[Tools Packages]
>>>this is some text<<< (Text to add here)
some text
some text
TIA.
Andrew.
I have a folder where I have multiple .ini files. I want to add some text to each file, but beneath a line of text that is present in each file.
i.e.
Text to add - this is some text
File:
some text
some text
[Tools Packages]
>>>this is some text<<< (Text to add here)
some text
some text
TIA.
Andrew.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you to you both, but paultomasi's solution is superb and does exactly what I need.
ASKER
Excellent, fast and accurate response.
You're welcome.
Thank you.
Thank you.
FIND /C /I "string_text_to_find" C:\folder_with_ini_files\b
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^TEXT_TO_ADD>>C:\