gisvpn
asked on
Search Batch file
Hi im using this to search a file for the word hotfix..
type C:\lab\tempRegistryextract .txt|finds tr -i "hotfix" > C:\Lab\%Computername%.txt
however i would like to be able to now search for lines which contain "XPQ i need to include the " in the search, how can i do this ?
type C:\lab\tempRegistryextract
however i would like to be able to now search for lines which contain "XPQ i need to include the " in the search, how can i do this ?
ASKER
i need to search for the actual string "XPQ i would like the " included as the string it searches
I think he wants to search for the word "XPQ
where the double quote is insert the search string.
I think you can 'escape' the double quote by using a backslash. i.e.
find "\"XPQ"
where the double quote is insert the search string.
I think you can 'escape' the double quote by using a backslash. i.e.
find "\"XPQ"
I don't think you can escape it with \ or ^....
See this PAQ - it explains a way around it: http:Q_20566636.html
See this PAQ - it explains a way around it: http:Q_20566636.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what a mistake i made, I actually meant findstr, not find. the escape character is for findstr.
for find, maybe you can try " as the escape character. i.e. """XPQ"
for find, maybe you can try " as the escape character. i.e. """XPQ"
gisvpn , you still messing with this batch stuff for searching the registry?? When am I going to convince you that there is a MUCH better way??
ASKER
Kavar
haahhaahahah - this is a project im just finishing ! Lots more coming !
haahhaahahah - this is a project im just finishing ! Lots more coming !
Hi,
type c:\lab\tempRegistryextraxt .txt|find "hotfix"|find """XPQ" >> C:\lab\%computername%.txt
above line will find all the lines that contain both the word hotfix and "XPQ
I have eliminated /i parameter to difference between capital and small letter( nor Hotfix or "xpq ..)
Observe use of 3 " to find "XPQ
Regards
type c:\lab\tempRegistryextraxt
above line will find all the lines that contain both the word hotfix and "XPQ
I have eliminated /i parameter to difference between capital and small letter( nor Hotfix or "xpq ..)
Observe use of 3 " to find "XPQ
Regards
uff , too slow
You need to find both hotfix and XPQ? in the same line?
type c:\lab\tempRegistryextraxt