if you
lets say the word ur looking for is Test
set /p ask=askFINDSTR /C:"%ask%" C:\Myfile
how come if you just type 'T' it guess it right away ? what am i doing wrong.
i would like to have it case senitive yet guess the whole name/words.
i read the Findstr /? still alittle lost.
how come
you can use "^pattern$" or better yet, you can download GNU grep for windows and use -o option grep -o "word" file
sorry i kinda fallow but well yeah :) lol
ghost dog nailed it: you have to use "regular expressions".
findstr will always find "H" regardless if it's "H", "Hell!", or "Hello the house"
but humble Findstr can do limited version of RE:
findstr /r "\<Hello\>" ffile
will find the word in any line in the file. if you want
the entire line to be just the one word:
findstr /r "^Hello$" ffile
findstr /r "^Hello$" can you use a variable there? because i tried to use a variable it didnt work , wouldnt find anything. that was in the variable.
if you want to use variable, then try using the syntax for DOS batch variable %var% ..
thanks that worked, now how could go about
find numbers? i mean like a IP address?
i mean find 1.1.1.1 whole string and not just if the users typed 1 in the SET /P IP=IP: it would find the whole string and not error because they didnt type 1.1.1.1.
that make sence?
i dont really want nothing 3rd party but either batch or VBS code to find exact strings, as descibe above. is there a VBS code that replace FINDSTR that the results could be tossed back into a batch file?
ive search the internet nothing seen so far.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |