I need a perl script which will create an output file after comparing two diff file in a directory path:
/export/home/abc/file1
/export/home/abc/file2
File Format: <IP>TAB<DeviceName><TAB>DESCRIPTIONS
file1:
10.1.2.1.3<tab>abc123def<tab>xyz.mm1.ppp.
#10.1.2.1.4<tab>abc345def<tab>xyz.mm2.ppp2.
10.1.2.1.5<tab>abc567def<tab>xyz.mm4.ppp3.
10.1.2.1.6<tab>abc789def<tab>xyz.mm5.ppp6.
#10.1.2.1.7<tab>abc009def<tab>xyz.mm9.ppp7
file2:
10.1.2.1.3<tab>abc123def<tab>xyz.mm1.ppp.
#10.1.2.1.4<tab>abc345def<tab>xyz.mm2.ppp2.
10.1.2.1.5<tab>abc009def<tab>xyz.mm7.ppp9
10.1.2.1.6<tab>abc567def<tab>xyz.mm4.ppp3.
#10.1.2.1.9<tab>abc009def<tab>xyz.mm9.ppp7
If IP and Device name both are match on both file1 and file2 then Out put file would say �duplicate IP and device found�. If just duplicate IP and or device found the output file will indicate �duplicate IP found� or �duplicate device found�
I don't care 3rd column; the script will look for match in 1st and/or 2nd column and must not ignore IP which has "#" in front of it.
OUTPUT:
Duplicate IP and device found:
10.1.2.1.3<tab>abc123def
#10.1.2.1.4<tab>abc345def
Duplicate IP Found:
10.1.2.1.6
10.1.2.1.5
Duplicate Device found
abc009def
Thank you very much. btw, this is not a home work.