如何通过排除 B 文件中的任何 MbrId 从 A 文件中获取行? A 是管道分隔文件

how to get the rows from A file by excluding any MbrIds in B file? A is pipe delimited file

文件 A 是竖线分隔的,500 万行:

600000002233199881|1000109668|2019-05-10|
600000002233199700|1000002681|2019-05-10|
600000002233199701|1000003390|2019-05-10|

文件 B 只有 1 列 ID,1 千行:

1000002681
1000109668

如何从 A 文件中获取不包括 B 文件中的 ID 的行?预期输出为:

600000002233199701|1000003390|2019-05-10|

我尝试了下面这个 link 中的 grep -Fwf fileB fileA,但对我的情况不起作用。我想知道如何改变它来工作。 https://unix.stackexchange.com/questions/110645/select-lines-from-text-file-which-have-ids-listed-in-another-file

要排除,您需要 -v 标志。

尝试grep -Fvwf fileB fileA。确保文件 B 末尾没有空行。

$ cat fileA 
600000002233199881|1000109668|2019-05-10|
600000002233199700|1000002681|2019-05-10|
600000002233199701|1000003390|2019-05-10|
$ cat fileB
1000002681
1000109668
$ grep -Fvwf fileB fileA
600000002233199701|1000003390|2019-05-10|
$