Text File Comparison
<JoJo wrote...
I have 2 separate text file each containing a bunch of IP addresses.
The first text file (TextIP-1.txt) contains 100 IP addresses; list 1
below the other.
The second text file (TextIP-2.txt) contains 56 IP addresses; listed 1
below the other.
I am looking to compare the content of these 2 text files & identify those
overlapping IP addresses that exist in BOTH of these text files.
Maybe the results can be printed to a third text file. Any help appreciated.
....
This is text processing. While you could do it in Excel, there are
MUCH BETTER tools you could use. If you're running any version of
Windows NT (NT 4, 2000, XP, Vista), the console command FINDSTR using
command line option /G:<file would be one superior alternative.
Still, this is an Excel newsgroup, so a pointless Excel approach: if
smaller file were imported into a single column range named IP and the
second file were imported into a different range with the first entry
in cell B2, then enter the following formula in C2,
=COUNT(MATCH(B2,IP,0))
and fill C2 down (or double-click its fill handle). These formulas
will evaluate to 1 for cells in B2:B# that match cells in the range
named IP and to 0 for cells with no match in IP. Autofilter B1:C#
selecting either 1 or 0 for the col C value, and paste the col B
results to blank worksheets, then save those blank workseets as text
files.
|