Alex Rivera | Logout

Escaping a quote in findstr search string

Asked 2011-02-13T06:29:52.400
12

How can I properly escape a quote in a search string when using findstr.exe?

Example:

findstr /misc:"namespace=\"" *.cs > ns.txt

This outputs to the console, instead of to the file I specified.

I am doing this directly on the command line, not actually in a batch file, though that information might be useful too.

Edit
Report

1 Answer

5

Found Re: FINDSTR search for a couble quote and redirect/pipe the output

Try this: 

findstr > x.txt /S /I /M /C:"\.\"" * 

I have no idea why this works.

Doesn't work for piping the output though. See the related link piping findstr's output

answered 2011-02-13T07:03:01.450

Your Answer