搜索使用批处理文件.txt文件里面一个字 [英] Search for a word inside .txt file using batch file

查看:85
本文介绍了搜索使用批处理文件.txt文件里面一个字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个批处理文件通过一个txt文件进行搜索,如果发现单词失败,然后退出1.任何帮助?

I am looking for a batch file to search through a txt file and if it finds the word "Failed" then EXIT 1. Any help??

推荐答案

下面是类似于加勒特说了些什么,但可以作为一个后台进程,而例如在标准输出上显示其他一些信息运行它:

here is something similar to what Garrett said, but you can run it as a background process while for instance displaying some other info on stdout:

@echo off
@start /wait FIND /C /I "SearchPhrase" path-to-your-file\filename.abc
IF ERRORLEVEL 1 (do-something)

这篇关于搜索使用批处理文件.txt文件里面一个字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆