Method for comparing files: similarities
Hi all
At work I occasionally need to do some text processing, and it would be very useful if I could identify a way of doing the following:
where there are 2 or more text files containing information on single lines, find a way of comparing the files and determining which lines are the same. The lines which are the same should be output in a useable format.
That's the best way I can find to phrase my question. The need arose at work to do this, and we kludged it using Excel. It was time consuming and ugly.
We don't use Linux at work, but I keep making a case. I've tried using the comm command (written by a Mr. Stallman no less!) but it didn't work very well.
Any pointers to a workable solution gratefully received. Google hasn't pointed me at much. There are plenty of utilities for finding out how files differ, but not much for finding out common text between files.
I vaguely thought about using sed, but I have no experience or skill with it.