Using this batch file that I found here:
@echo off
setLocal EnableDelayedExpansionfor /f "tokens=* delims= " %%a in (sessopen.log) do (
set var=%%a
)
echo !var!
I get this result from my file I'm looking at:02/01/12 10:00:00 AM Session 3 is closed
I want to compare the last word of that file. The word will either be Open or Closed. Everything else isn't necessary for me to look at. I'm just wanting to check either Open or Closed.
So above batch file runs then,If last word is Open goto something (i can handle)
if last word is Closed goto something
How do I do that?The echo command in the batch file will not be used, just in there for testing atm.
Thanks in advance.
@echo off
for /F "tokens=7" %%a in (sessopen.log) do set var=%%a
if /I "%var%"=="closed" (goto :CLOSED) else (goto :OPEN)
goto :EOF:CLOSED
...
goto :EOF:OPEN
...
goto :EOF
| « [Solved] Continue with next file i... | FTP download » |