Computing.Net > Forums > Programming > findstr within findstr using batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

findstr within findstr using batch

Reply to Message Icon

Name: cyoulater
Date: December 14, 2007 at 04:44:52 Pacific
OS: XP
CPU/Ram: 512
Product: Dell
Comment:

Hello, I am new to batch programing and do not know how to program the following scenario. Any help would be great.

I want to search a .txt called API.log for a string named "<TrdCaptRptReq". Once it finds all the lines containing this string, I want to store it and then search for the following two strings: ReqTyp="1" and SubReqTyp="0". Only if both searchs are successful, do I want to display a Successful test mesasge. Otherwise, it should display "Test Failed"

Thanks again for all the help, I really need it.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: December 14, 2007 at 14:14:12 Pacific
Reply:

Untested (and ungodly long, so line wrap in play):
@find "<TrdCaptRptReq" API.log | find "ReqTyp=""1""" | find "SubReqTyp=""0""" &&(@echo Successful test)||(@echo Test Failed)


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: findstr within findstr using batch

How to seach *.mp3 etc using batch www.computing.net/answers/programming/how-to-seach-mp3-etc-using-batch/15950.html

Using batch script print filenames in folder www.computing.net/answers/programming/using-batch-script-print-filenames-in-folder-/19171.html

Rename multiple iles in folder using Batch www.computing.net/answers/programming/rename-multiple-iles-in-folder-using-batch/19638.html