2012-11-29 30 views

回答

2

準備使用的-PROGRAMM
一方面,有一點點C-PROGRAMM從悉尼大學叫Sherlock,這不正是你想要的東西:顯示相似的百分比。你只需要自己編譯它,但我認爲這不會是一個問題。

自己
在另一方面做吧,如果你正在使用基於Unix的系統,並想自己做這一切還有就是comm命令:

compare two sorted files line by line and write to standard output: 
the lines that are common, plus the lines that are unique. 
(taken from the manpage) 

重要的是這裏需要注意的是comm只能工作排序文件,所以你必須先排序他們兩個。如果你有兩個文件,說first.txtsecond.txt你可以使用comm這樣的:

comm -12 <(sort first.txt) <(sort second.txt) 

-12 - 選項指定抑制這兩個文件中的獨特線條,讓你只會得到出現在這兩個文件行。

+0

+1,謝謝,我會結賬Sherlock – Michael

+0

查了Sherlock,看起來不錯,回答接受。 – Michael