I have the following script (trimmed down for example purposes):
Code: Select all
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET X=T
PUSHD "D:\TEMP"
IF DEFINED X (
SET "SEARCH="Rule Name","File Name:","Error: 3303","Error: 3304","Error: 3333","Error: 3335","Error: 3336","Error: 3337","does not exist for the specified cube or you do not have access to it""
SET "FDMEE_KOF=_KICKOUTS_.txt"
FOR %%A IN ( !SEARCH:,= ! ) DO (
FOR /F "tokens=* delims=" %%a IN ('FINDSTR /C:"%%~A","20200711_1055_FIN_IQ_2002.log"') DO (
ECHO %%a>>"!FDMEE_KOF!"
)
)
POPD & EXIT /B 1
)
CLS
GOTO :EOF
Code: Select all
( !SEARCH:,= ! ) DO (
Now I could just put the SEARCH variable outside the block, but I don't want to do that. ANy ideas?