@ECHO off
setlocal EnableDelayedExpansion
set "VAR=da da da YES123123"
echo %VAR% > testing.txt
FOR /F %%a in ('findstr "YES" .\testing.txt') do (
set BLAH=%%a
set "BLAH2=%BLAH: =%"
set "FINAL=%BLAH2:~15%"
echo %FINAL%
)
endlocal
Whether WITH or WITHOUT "setlocal EnableDelayedExpansion" the batch file simply does not work.
But that's all I have so far. However I also want to strip the preceding characters from the FINDSTR string, but set a variable to the FINDSTR string AND IT'S SUCCEEDING 123123 characters. Unfortunately, it doesn't work. It only outputs "ECHO is off."
I have used FOR correctly in other ways, but I can't figure it out this time. Any help would be greatly appreciated.
YES123123
? Is it always the last "word"? – Stephan