我試圖從目錄樹中的文件中獲取行,其中包含單引號或雙引號。舉個例子,我想這些線路用單FINDSTR命令:如何使用FINDSTR獲取簡單的或雙引號的行
You should be able to get a "Hello world" program really quick.
Enter a value for params 'name' and 'age', please.
If no value is entered for 'name' param, the "Hello world" program will throw an exception.
我可以只用單引號(findstr /srn \' *.txt
)線,只雙引號(findstr /srn \^" *.txt
),或同時使用單引號和雙引號(findstr /srn \'\^" *.txt
),但我只需要帶單引號或雙引號的行,只需一個命令。
有關如何實現它的任何想法?
如果我嘗試這個命令行塊,直到我停止它,而不打印任何東西。我讀過雙引號在這種情況下可能會導致問題,我想知道該問題的解決方法。 – jgg
@jgg - 一旦引用已經以較早的'''開始,'''不能''''轉義'''參見[我的答案](http://stackoverflow.com/a/16795153/1012053)爲了正確的方法來逃避''''。 – dbenham
@dbenham謝謝;糾正了我的答案 –