generate a matrix of similarities between multiple files
Hi all,
I have four files
file1
one
two
three
four
file2
one
two
five
file3
three
four
five
file4
four
five
one
two
And I want to compare them and create a matrix with number of common lines between them, such as:
file1 file2 file3 file4
file1 0 2 2 3
file2 2 0 1 3
file3 2 1 0 2
file4 3 3 2 0
Could someone help me of writing a perl script? Can I do that quickly with awk? I tried to create arrays of arrays, but it doesn't work.
I would appreciate if you can help me.
thanks
|