Domanda

I have two files, say: File 1:

a 1
b 2
c 3
d 4
e 5
f 6
g 7

and File 2:

a 1
b 2
d 4
e 5
c 3
f 60
g 70

I want the comparing tool to notice that c, d and e lines are just permute each other and not shown them as different. Only f and g are really dissimilar and should be shown.

I have tried tools like Meld, Diffuse or Kompare but they don't help. How can I do that?

This is the file actually and I think simple sort can't help.

ATOM     28  OE1 GLN     2      -2.520  35.720  25.080 -0.6086 1.6612
ATOM     29  NE2 GLN     2      -0.770  36.990  25.460 -0.9407 1.8240
ATOM     30 HE21 GLN     2       0.060  37.430  25.080  0.4251 0.6000
ATOM     31 HE22 GLN     2      -1.220  37.300  26.300  0.4251 0.6000
ATOM     32  C   GLN     2      -0.460  35.190  20.480  0.5973 1.9080
ATOM     33  O   GLN     2      -1.520  34.880  19.940 -0.5679 1.6612
È stato utile?

Soluzione

You can use bash's process substitution:

diff <(sort file1.txt) <(sort file2.txt)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top