in reply to comparing lists

I do that sort of thing with various lists and flat-file tables so often that I wrote my own utility to make it easy and flexible; I posted it here -- it's a few years old, but I still use it on almost a daily basis.

Update: Grandfather's code is of course more relevant for you, and neater, because it does a bunch of files in one swoop. My own tool just compares two lists at a time (like "diff" or "cmp"), but for many cases, you can just chain runs together through a pipe -- e.g. print rows in file1 whose initial field does not match any rows in file2 or file3, and do match rows in file4:

cmpcol -x1 -l1 file1 file2 | cmpcol -x1 -l1 stdin file3 | cmpcol -i -l +1 stdin file4