[Gllug] simple file matching

Tethys sta296 at astradyne.co.uk
Wed Aug 24 09:43:53 UTC 2005


n3lly b0y writes:

>I recently had to match a list of items in one file with that of  
>another. The lists were unordered and using diff or comm didn't work  
>for me.

If the lists are unordered, then fix that first, so the standard tools
work:

sort -u file1 > file1.sorted
sort -u file2 > file2.sorted
comm -12 file1.sorted file2.sorted

>results were okay (a couple of double entries for some reason)

You could have removed double entries by piping the result through
"sort -u".

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list