Solved Batch File that searches the word then deletes it

April 29, 2018 at 22:53:06
Specs: Windows 7
I have this batch file that can store the word after the input.

Here's the code:
Set text=
set /p text=Enter text:
echo %text%>> inputs.txt
pause.

But the thing here I want to search the word in the inputs.txt then deletes it.

I come up with this but I find it diffucult.

:delete
set /p "findd= What data will you delete? "
for /f "delims=" %%a in ('find "%findd%" inputs.txt') do
Set "%findd%=%%a"

I tried googled some solutions that might help but none of them is right.

How will I search a word then deletes it in batch file?


Thank you!!!!!!

message edited by marcker2


See More: Batch File that searches the word then deletes it

Report •

#1
Report •
Related Solutions


Ask Question