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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-19-2007
Ygor's Avatar
Ygor Ygor is offline
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,261
If the files are sorted correctly, then try using join...
Code:
$ head file[12]
==> file1 <==
71664107;1;1;05-FEB-07;12-FEB-07;

==> file2 <==
U;71664107;dummy;Pirovano;M;04-SEP-75;Georgia;MI;1;1;31;S;S;;;Y;05-02-2007;0;12-FEB-07;

$ join -t ';' -1 2 -2 1 file2 file1
71664107;U;dummy;Pirovano;M;04-SEP-75;Georgia;MI;1;1;31;S;S;;;Y;05-02-2007;0;12-FEB-07;;1;1;05-FEB-07;12-FEB-07;
Reply With Quote