Findstr错误。 FINDSTR:无法打开

问题描述 投票:0回答:1

我有 2 个文件。第一个包含电子邮件地址和姓名的 csv 文件 mail_list.csv:

email,Name
[email protected],name1
[email protected],name2
[email protected],name3
[email protected],name4
na[email protected],name5
[email protected],name6
[email protected],name7

第二个文件仅包含电子邮件地址mail_list_to_remove.csv

[email protected]
[email protected]
[email protected]

如果电子邮件地址存在于,我想从 mail_list.csv 中删除条目 mail_list_to_remove.csv 使用 findstr 命令。

当我尝试简单的命令时,例如:

findstr @ mail_list.csv

findstr @ mail_list_to_remove.csv

我得到了正确的结果。但是当我尝试以下命令时:

findstr /g:mail_list_to_remove.csv /f:mail_list.csv

我收到错误消息:

FINDSTR: Cannot open email,Name
FINDSTR: Cannot open [email protected],name1
FINDSTR: Cannot open [email protected],name2
FINDSTR: Cannot open [email protected],name3
FINDSTR: Cannot open [email protected],name4
FINDSTR: Cannot open [email protected],name5
FINDSTR: Cannot open n[email protected],name6
FINDSTR: Cannot open [email protected],name7

我做错了什么或者 findstr 不是解决这个问题的合适工具吗?

提前感谢您的帮助。

windows command-line findstr
1个回答
0
投票

尝试使用

findstr /g:mail_list_to_remove /f:mail_list.csv
代替

© www.soinside.com 2019 - 2024. All rights reserved.