我有2个以竖线分隔的文件.昨日.txt和今天.txt
昨日.txt:
1234|12|Bill|Blatt|programmer
3243|34|Bill|Blatt|dentist
98734|25|Jack|Blatt|programmer
748567|31|Mark|Spark|magician
Today.txt
123|12|Bill|Blatt|programmer
3243|4|Bill|Blatt|dentist
934|25|Jack|Blatt|prograbber
30495|89|Dave|Scratt|slobber
I would like to compare the 2 files while ignoring the first 2 fields and output any lines unique to the second file (Today.txt), but I want the full lines even though the comparison is omitting the first 2 fields. So in the case above the output would be:
new_Today.txt
934|25|Jack|Blatt|prograbber
30495|89|Dave|Scratt|slobber
我试着用这个来完成:
sort <(cut -d"|" -f3- yesterday.txt) <(cut -d"|" -f3- yesterday.txt) <(cut -d"|" -f3- Today.txt) | uniq -u
这几乎是有效的,但它没有给我我削减的两块田地.我不确定该如何做到这一点.任何帮助都将不胜感激.