2017-02-16 31 views
1

1.批找到引号

我使用的代码文件

>nul find "uset g_save_format "2"" log.txt && (
    echo "uset g_save_format "2"" was found. 
) || (
    echo "uset g_save_format "2"" was NOT found. 
) 

找到测试如何找到与 “” 一文,例如文本:

uset g_save_format "2" 

2。

cd c:\ 
cd c:\users\%username%\Documents\ 
>nul find "uset g_save_format ""0""" config.cfg && (
    goto savepyt 
) || (
    goto scsc 
) 

如何用find查找我的代码海峡?

我有一个问题与FINDSTR

findstr /c:\users\%username%\Documents\ "uset g_save_format \"2\"" 

回答

2
>nul find "uset g_save_format ""2""" log.txt && (
    echo "uset g_save_format "2"" was found. 
) || (
    echo "uset g_save_format "2"" was NOT found. 
) 

保存路径在FIND(虽然它不是由MS记录)命令引号使用引号逃脱。 你也可以尝试用FINDSTR -

findstr /c:"uset g_save_format \"2\"" 
+1

1)它是[记录](https://technet.microsoft.com/en-us/library/bb490906.aspx):*“如果字符串你想要搜索包含引号,则必须对包含在字符串“* 2”中的每个引号使用两个引号,“findstr'示例缺少'/ c:' –

+0

@MCND - 谢谢。 – npocmaka

+0

@MCND - 它在FIND /?中缺失 – npocmaka