jac*_*see 7 windows unicode grep
我有一个unicode文本文件的集合(从regedit导出),我想拉出所有带有特定文本的行.
我已经尝试过Grep for Windows和findstr,但两者似乎无法处理unicode编码.我的结果是空的,但是当我使用-v选项(显示不匹配的行)时,输出在每个字符之间显示NUL.
是否有任何免费选项可以在Windows中对Unicode文件执行简单的grep?
Joe*_*oey 10
好吧,虽然findstr无法直接处理Unicode文件,type但findstr实际上并没有问题地处理Unicode 输入.
所以你需要做的就是
type myfile.txt | findstr /c:"I'm searching for this"
Run Code Online (Sandbox Code Playgroud)
> type uc-test.txt Unicode test. äöüß Another line Something else > findstr "Something" uc-test.txt > findstr /v "Something" uc-test.txt ?U n i c o d e t e s t . õ ÷ ³ ? A n o t h e r l i n e S o m e t h i n g e l s e > type uc-test.txt | findstr "Another" Another line
| 归档时间: |
|
| 查看次数: |
8111 次 |
| 最近记录: |