The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 08-04-2008
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,433
You can use the join command (input files must be sorted on the first column) :
Code:
join kamal1.dat kamal2.dat

Input file 1 (kamal1.dat) :
Code:
111
222
333
888

Input file 2 (kamal2.dat) :
Code:
000 1000
111 1111
222 1222
444 1444
777 1777
888 1888
999 1999

Output :
Code:
111 1111
222 1222
888 1888

Jean-Pierre.