in reply to Comparing strings (exact matches) in LARGE numbers FAST
$ sort file1 > file1.sorted $ sort file2 > file2.sorted $ comm -12 file1.sorted file2.sorted
In bash (in several other shells probably as well, but I don't know them well enough), you can even do it as a one-liner, without the use of temporary files (*):
$ comm -12 <(sort file1) <(sort file2)
(*) Well, sort may use temporary files if the file to be sorted cannot be held in memory, but it'll clean up afterwards.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comparing strings (exact matches) in LARGE numbers FAST
by perlSD (Novice) on Aug 29, 2008 at 20:20 UTC |