【发布时间】:2015-01-29 22:34:52
【问题描述】:
我必须使用批处理脚本安装/卸载一些产品,并使用日志文件检查是否已安装或卸载...
因此,如果产品安装正确,我的日志文件中的某处会有这样一行(不带引号):
“SOMETEXT Windows Installer a installé le produit. SOMETEXT”
我想检测(不带引号)“Windows Installer a installé le produit”是否(不带引号)。存在于我的文件中...
我尝试了很多方法,例如:
正则表达式“^.Windows[ ]Installer[ ]a[ ]install,[ ]le[ ]produit.$” (不匹配)
修剪每一行并尝试 findstr "WindowsInstallerainstall,leproduit" (没用)
所以我希望你能给我一个解决方案,因为我正在寻找一个 3 周的解决方案......
谢谢
【问题讨论】:
-
findstr /C:"Windows Installer a installé le produit." logFile.txt
标签: regex string batch-file trim findstr