Microsoft windows 10 企业机器上的这个 FINDSTR 命令有什么问题

What is wrong wit this FINDSTR command on microsoft windows 10 enterprise machine

过去一个小时一直在尝试完成这项工作,但看不出有什么问题。

FINDSTR /M /C:"260255" productattributes_20190413_000001.775.txt>Err.txt

string 260255 在文件 productattributes_20190413_000001.775.txt 中可用,我正在从该文件所在的目录执行该命令。 Err.txt执行此命令后为空

完整命令 -

C:\Users\nmangal\Desktop\feed_for_prod\price\attributes>FINDSTR /M /C:"260255" productattributes_20190413_000001.775.txt>Err.txt

我怀疑你的文件是 UTF-16,在这种情况下 findstr 将找不到文本,因为中间有空值。

因此,一种解决方案是将文件转换为 UTF-8。

我不知道有什么方法可以使 findstr 处理 UTF-16。事实上,Wikipedia 表示,

However, while the find command supports UTF-16, findstr does not.

因此,另一种解决方案可能是使用 find