开发者

How to fetch exact string from a text file

开发者 https://www.devze.com 2022-12-19 18:07 出处:网络
here is me requirement. I have one text file and I need to get exact specified string from that file C:>type small.txt | find \"small2\"

here is me requirement.

I have one text file and I need to get exact specified string from that file

C:>type small.txt | find "small2"

small2

small22

small20

C:>type small.txt small2

small22

small20

C:>type small.t开发者_StackOverflow中文版xt | find "small2" small2

small22

small20

C:\

Here it is giving all the words instead of only "small2"


echo small2

Will give you the same result


Ok.. I got the solution

C:\>findstr "\<small20\>" small.txt
small20
C:\>
0

精彩评论

暂无评论...
验证码 换一张
取 消