I need to compare two txt files. Every line of both txt files contain entries. One entry per line. The new file contains entries the old one lacks. I have tried to use diff
and vimdiff
but these don't work because the lines may be in different order.
For example:
OLD FILE
alpha
beta
gama
NEW FILE
delta
omega
beta
alpha
gama
rho
phi
diff
and vimdiff
compares line 1 with line 1, line 2 with line 2, etc and even if I sort both files the comparison will not succeed because I can have new items between the sorted versions, like "alpha, beta, rho" versus "alpha, beta, gama, rho".
How do I get a list of entries that the new file have that the old one does not?
diff
over the sorted files should not work. – Hauke Laging Nov 02 '14 at 14:29