filtering text with double quotation marks
I'm trying to filter the following, but the double quotationmarks are confusing me.
(load "")
the code I have so far is:开发者_JAVA百科
find /v ""(load "")" < C:\acadlsip.txt | find /v ""(load "")" > acad.lsp
Using a file (thing.txt
) with the following content:
this is a test.
(load"")
this is more of a test
(load"")
hello.
I ran the following command:
find /v "(load"""")" < thing.txt
and got this output:
this is a test.
this is more of a test
hello.
Which I guess what you are looking for. The thing to remember here is that entering ""
(two quotes) in the middle of the string is interpreted (in this context) as a single quote.
I will also mention that you don't need to run the same find twice in order to pipe the output to another file. You can instead use this:
find /v "(load"""")" < thing.txt > thing2.txt
findstr /v (load\"\") th1.txt > th2.txt
精彩评论