當我使用find命令搜索字符串並打印字符串時,也會打印文件名。有沒有辦法避免打印文件名?在批處理腳本中使用'FIND'命令時避免打印文件名
對於防爆: 考慮一個文件Sample.log包含,
INF000005: <0> Error(s) and <0> Warning(s) detected.
INF000006: Execution completed successfully.
我運行以下命令的批處理文件。
find " error " Sample.log >Result.txt
中的Result.txt輸出的電流
---------- .\Sample.log
INF000005: <0> Error(s) and <0> Warning(s) detected.
中的Result.txt
預計產量
INF000005: <0> Error(s) and <0> Warning(s) detected
謝謝...它的工作非常好... –