文件1:
'SR'|'2017-09-01 00:19:13'|'+05:30'|'1A3LA7015L5O'|'5042449534546015801549'
'SR'|'2017-09-01 00:19:13'|'+05:30'|'1A3LA7015L5O'|'5042449534546015801677'
'SR'|'2017-09-01 00:19:13'|'+05:30'|'1A3LA7015L5Q'|'5042449536906016501541'
'SR'|'2017-09-01 00:19:20'|'+05:30'|'1A3LA7015L6I'|'5042449603146028701541'
文件2:
'SR'|'2017-09-01 00:19:13'|'+05:30'|'1A3LA7015L5Q'|'5042449536906016501541'
'SR'|'2017-09-01 00:19:20'|'+05:30'|'1A3LA7015L6I'|'5042449603146028701548'
我想要的输出是A-B和B-A
我尝试了以下命令,但似乎不起作用。
var1=5
awk -F "|" -v col="$var1" 'NR==FNR{a[$2];next} !($col in a)' File1 File2
awk -F "|" -v col="$var1" 'NR==FNR{a[$2];next} !($col in a)' File1 File2
我得到了解决方案,我正在做的错误是给出错误的列号 {a[$2];next}
我必须将第五列与它进行比较,就像:
awk -F "|" -v col="$var1" 'NR==FNR{a[$5];next} !($col in a)' File1 File2
awk -F "|" -v col="$var1" 'NR==FNR{a[$5];next} !($col in a)' File1 File2