Can you help me understand why this wont work?
Code: Select all
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%A IN ( coreapplication_obips1 coreapplication_obiccs1 coreapplication_obisch1 coreapplication_obijh1 coreapplication_obis1 ) DO (
for /f "tokens=4 delims=|" %%B in ('findstr/r "^[\ \ ]*%%A" "C:\Hyperion_Batch\opmn.txt" ') do set "HYP_VAR=%%B"
echo %%A = %HYP_VAR% >> "C:\Hyperion_Batch\results.txt"
)
%HYP_VAR% remains empty. I assume it something do with variable expansion but I thought I took care of that.
Here is the file:
Code: Select all
Processes in Instance: instance1
---------------------------------+--------------------+---------+---------
ias-component | process-type | pid | status
---------------------------------+--------------------+---------+---------
coreapplication_obips1 | OracleBIPresentat~ | 1328 | Alive
coreapplication_obiccs1 | OracleBIClusterCo~ | 10220 | Alive
coreapplication_obisch1 | OracleBIScheduler~ | 5400 | Alive
coreapplication_obijh1 | OracleBIJavaHostC~ | 8852 | Alive
coreapplication_obis1 | OracleBIServerCom~ | 5516 | Alive
Thanks!