我想比較兩個文件file1.txt和file2.txt的前兩列,如果他們匹配寫入另一個文件output.txt與文件1,文件2的第三列以及是否匹配的詳細信息。比較兩個文件的兩列,並顯示第三列的輸入,如果它匹配不在unix
FILE1.TXT
ab|2001|name1
cd|2000|name2
ef|2002|name3
gh|2003|name4
FILE2.TXT
xy|2001|name5
cd|2000|name6
ef|2002|name7
gh|2003|name8
output.txt的
name1 name5 does not match
name2 name6 matches
name3 name7 matches
name4 name8 matches
你到目前爲止試過了什麼?你看過'awk'嗎? – lurker
是的,但我無法打印出第一個文件的第三列 – CSP
然後請具體說明您的嘗試。 – lurker