如何使用FINDSTR在一行中搜索多个串 [英] How to use findstr to search for multiple strings in one line

查看:163
本文介绍了如何使用FINDSTR在一行中搜索多个串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我希望能够搜索字符串[失败]和字符串。这两者都是在一个文本文件内的同一行上。我会怎么做呢?

So I want to be able to search for the string "[ FAILED ]" and the string "." that are both on the same line inside of a text file. How would I do this?

我试过这样:

FINDSTR / C:[失败]/ C:。 output_.txt

,但它产生包含任一字符串的行。如果可能的话我也希望能够排除包含从我发现号的行。

but it produces lines that contain either of the strings. If possible I also want to be able to exclude any lines that contain numbers from my finds.

推荐答案

我已经回答了使用管道和未来与下面的命令我自己的问题:

I have answered my own question using piping and coming up with the following command:

FINDSTR / C:[失败]output_.txt | FINDSTR / C:。 | FINDSTR / V [0-9]

这篇关于如何使用FINDSTR在一行中搜索多个串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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