The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



Thread: Compare files
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-10-2007
kharen11 kharen11 is offline
Registered User
 

Join Date: Mar 2007
Location: Manila
Posts: 25
Compare files

Hi Masters! I know this problem is quite difficult.
I have two files that looked like this:

File1
mary a b d
anne d e
jane g h
sam a


File2
role1 a d c d
role2 e f g h
role3 a b d
role4 a d e
role5 g h


It will first look into file1 then compare to all entries in file2 regardless of arrangement.

The output should be:
mary role1 role3
anne role 4
jane role2 role5
sam role1 role3 role4


I've tried some other way to do this but unsuccessful. Can it be done in UNIX? Please help. Thanks!
Reply With Quote
Forum Sponsor