批量查找带引号的文本

时间:2017-02-16 12:13:12

标签: batch-file find

1

我使用代码在文件中找到测试

Select r.R_ID, r.Name, listagg(c.char_val,',') WITHIN GROUP(ORDER BY c.char_val) AS Char_Val
From Records r, Char c
where r.R_ID = c.R_ID
GROUP BY r.R_ID, r.Name

如何使用""来查找文本例如:

>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.
)

2

uset g_save_format "2"

如何使用findstr编写我的代码?

我在使用findstr

保存路径时遇到问题
cd c:\
cd c:\users\%username%\Documents\
>nul find "uset g_save_format ""0""" config.cfg && (
  goto savepyt
) || (
  goto scsc
)

1 个答案:

答案 0 :(得分: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\""