我有两个文件,其中一个文件的数据是该列的事务值。假设货币代码和另一个文件具有有效的/预期的货币代码。
File1:
ID | col1 | curr_cd
abc1 | | INR
2 | def |
美元3 | xyz | 3 ab
4 |德国莱茵| ABC
…
File2
curr_cd
INR
美元CAD
…
我需要无效值的列表,这意味着存在于File1中,但不存在于File2中。File1可能包含数百万个事务,因此我需要一个AWK或一个可以更快地给出结果的命令。
有谁能帮我一下吗?# Returns whole row
fgrep -vf file_2 file_1
# Returns just the bad value
fgrep -vf file_2 file_1 | awk -F '|' '{print $2}'