in reply to file comparison
I wrote and posted a utility here, called cmpcol that handles this directly as a command line:
That will treat use the first comma-delimited string on each line of each file as a hash key, and print the set of lines whose keys are unique to the first of the two files (-x1, for exclusive-or set from file1, oldlist in this case). It will also do intersection and union of the two lists.cmpcol -d ',' -x1 -l1 oldlist newlist
By default, it only prints the key fields that meet the stated conditions, but the "-l1" ("list full line of file1") gives you what you want. If you wanted to compare old and new data for people in both lists, you could do:
(produce intersection, list full lines of both files).cmpcol -i -d ',' -lb oldlist newlist
|
|---|