Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
renzlo
- Posts: 116
- Joined: 03 May 2011 19:06
#1
Post
by renzlo » 13 Aug 2011 11:36
Hi All,
How do you escape double quotes (") in using findstr?
Example:
source.txt
Search string is equal to:
findstr /ric:"","[a-z]" source.txt - this doesn't work
findstr /ric:"^",^"[a-z]" source.txt - doesn't work too
what else?
Thanks in advance.
-
taripo
- Posts: 228
- Joined: 01 Aug 2011 13:48
#2
Post
by taripo » 13 Aug 2011 18:08
findstr /? says
\x Escape: literal use of metacharacter x
Also, I guess /r and /c are things you wouldn't use together
and that you'd want /r 'cos regex.
C:\abc>findstr /ri ","[a-z] source.txt
C:\abc>findstr /ri ^",^"[a-z] source.txt
C:\abc>findstr /ri \",\"[a-z] source.txt <-- that's it!
"Paul","Mike"
C:\abc>
-
renzlo
- Posts: 116
- Joined: 03 May 2011 19:06
#3
Post
by renzlo » 13 Aug 2011 19:51
thanks for the reply taripo.