Search found 7 matches
- 14 Feb 2014 02:12
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
using Findstring to find a string in a file.
ECHO OFF set return_code = 0 IF findstr /i "ERROR_OCCURRED" test.log > nul ( set return_code = 6 rem exit /B 0 echo %return_code% ) else ( IF findstr /i "WARNING_OCCURRED" test.log > nul ( set return_code = 4 rem exit /B 0 echo %return_code% ) else ( set return_code = 0 rem exit ...
- 14 Feb 2014 01:05
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Re: Batch file to read a file for specific words
ECHO OFF set return_code = 0 IF findstr /i "ERROR_OCCURRED" test.log > nul ( set return_code = 6 rem exit /B 0 echo %return_code% ) else ( IF findstr /i "WARNING_OCCURRED" test.log > nul ( set return_code = 4 rem exit /B 0 echo %return_code% ) else ( set return_code = 0 rem exit ...
- 12 Feb 2014 21:18
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Re: Batch file to read a file for specific words
@echo off set ret=0 findstr /i "Successfully" "file.log" >nul && set ret=1 findstr /i "Failed Aborted" "file.log" >nul && set ret=2 exit /B %ret% Thanks for the reply. How can i test this to make sure it is returning a value. I have tried call...
- 12 Feb 2014 05:38
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Re: Batch file to read a file for specific words
and return a based on the values. the batch script should value 1, for fialed/aborted it should be 2.. Maybe you can explain what the above means (because it is missing some words) and how it is being used. Sorry for the confusion This is how the process will be: 1. External process call this batch...
- 12 Feb 2014 05:00
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Re: Batch file to read a file for specific words
Thanks for the reply.
Will batch script returns a value to the calling process? if so can you please provide some sample.
thanks,
EshwarK
Will batch script returns a value to the calling process? if so can you please provide some sample.
thanks,
EshwarK
- 12 Feb 2014 04:36
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Re: Batch file to read a file for specific words
Thanks for the reply.
But will it return a value to a outside process which is calling batch file? If so can you please give me an example of this.
-EshwarK
But will it return a value to a outside process which is calling batch file? If so can you please give me an example of this.
-EshwarK
- 12 Feb 2014 03:44
- Forum: DOS Batch Forum
- Topic: Batch file to read a file for specific words
- Replies: 13
- Views: 10006
Batch file to read a file for specific words
Hi Team, I have requirements where an external processes call a batch file this batch file should read the log file and find for specific words like "Successfully","Failed","Aborted" and return a based on the values. Like if it finds successfully then the batch script s...