hi guys,
i can't to get it to work,
for /F "tokens=1*" %%i in (%File_dbname%) do (
for %%A in (%%j) do (
echo **********************************************************************>>%output-file%
echo %%A DB daily check ORA-ERROR at %%i>>%output-file%
echo **********************************************************************>>%output-file%
echo .>>%output-file%
echo .>>%output-file%
REM if NOT exist alert_%%A.log (
REM echo alert_%%A.log Not found>>%output-file%
REM )
:: print out all ORA- errors along with their associated timestamps
findstr /br "Sun\> Mon\> Tue\> Wed\> Thu\> Fri\> Sat\> ORA-[0-9]*" alert_%%A.log|findstr /r "!LF!ORA- ^ORA-">>%output-file%
If ERRORLEVEL 1 echo NO ORA- error found in alert_%%A.log>>%output-file%
echo .>>%output-file%
echo .>>%output-file%
IF NOT EXIST alert_%%.log echo no new alert_%%A.log generated>> %output-file%
)
)
basically is when it loop through the list of files (which is dynamically) and if that particular files is not found, it will says that particular log is not generated yet.
please help.
if not exist doesn't seem to be working
Moderator: DosItHelp
Re: if not exist doesn't seem to be working
IF NOT EXIST alert_%%.log
The %% needs something else there.
The %% needs something else there.
-
- Posts: 43
- Joined: 08 Mar 2013 11:23
Re: if not exist doesn't seem to be working
oh...hmm...ok...
i amend it as alert_%%A.log already. But seem to be still the same.
i amend it as alert_%%A.log already. But seem to be still the same.
Re: if not exist doesn't seem to be working
Under the top line below, add the next two lines. Then run it and see what is being printed.
Code: Select all
IF NOT EXIST alert_%%A.log echo no new alert_%%A.log generated>> %output-file%
echo IF NOT EXIST alert_%%A.log echo no new alert_%%A.log generated
pause
-
- Posts: 43
- Joined: 08 Mar 2013 11:23
Re: if not exist doesn't seem to be working
it start to print out those files that actually exist in the folder !!!
which should be printing those files that did not exist in the folder ! i am confuse.
which should be printing those files that did not exist in the folder ! i am confuse.
Re: if not exist doesn't seem to be working
It will print out every line with that echo command.
Do any of the filenames have spaces or & characters in the filename?
Are there any error message as well?
Do any of the filenames have spaces or & characters in the filename?
Are there any error message as well?
Re: if not exist doesn't seem to be working
Please post a typical line of your %File_dbname%.
Regards
aGerman
Regards
aGerman