How can I compare data in 2 files to identify common and unique data ? I can't do it line by line because I have file 1 which contains say 100 id/codes/number-set and I want to compare a file 2 to file 1.
The thing is that file 2 contains a subset of data in file 1 and also data unique to file 2, for example:
file 1 file 2
1 1
2 a
3 2
4 b
5 3
6 c
How can I compare both files to identify data that is common and unique to each files? diff
can't seem to do the job.
diff
andcomm
among others that can do it natively and are part of the basic UNIX tool set. What's more, this question would not be well received on SO at all, it has no code and would expect others to just write the entire program for the OP. Please be careful when suggesting users post elsewhere. Be sure you understand the scope of both sites before making such suggestions in the future.