Computing.Net > Forums > Programming > Compare two files for match -solari

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Compare two files for match -solari

Reply to Message Icon

Name: jacky599
Date: October 21, 2008 at 07:46:47 Pacific
OS: solaris
CPU/Ram: solaris
Product: 10
Comment:

I am using solaris, need either awk/shell or perl script to compate two files.
both of these file1 and file2 are located in two diffent location path in the same server.
file1 location: /export/db/mna
file2: /etc/dba

The script will compare in file1 first field (e.g. abc00asp)before colon:
and will look for match in file2 second field (e.g. abc00asp)


File1 format:


abc00asp:11.83.0.1
def01asp:11.83.0.2
efg00asy:11.83.0.5
rkl01atm:11.83.0.6
ppr00rsm:11.83.0.7
trt00nsm:11.83.0.8

File2 Format:

172.25.0.97 abc00asp abc00asp.atl.mnn.net
172.25.0.97 ppr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 bppr00rsm pr00rsm.atl.mnn.net
172.25.0.97 ypr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 ppr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 trt00nsm trt00nsm.atl.mnn.net


The outfile will indicate match files:


abc00asp
ppr00rsm
trt00nsm


Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: jacky599
Date: October 21, 2008 at 11:08:59 Pacific
Reply:

The output file will show match items and then unmatch items.

Thanks


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Compare two files for match -solari

Compare two files with an input fil www.computing.net/answers/programming/compare-two-files-with-an-input-fil/17089.html

Comparing two files www.computing.net/answers/programming/comparing-two-files/13292.html

compare two file www.computing.net/answers/programming/compare-two-file/19932.html