The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #2 (permalink)  
Old 09-27-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,420
Try an adapt the following awk program :
Code:
BEGIN {
   FS = OFS = ",";
}
FNR == NR {
   Descr[$1,$2] = $3;
   next;
}
{
   if (($3,$4) in Descr) 
      print $0,Descr[$3,$4];
   else
      print $0,"Unknown Account";
}
Execute the program with the command :
Code:
awk -f program.awk File_1 File_2
The account description will be append to the end of each line of File_2.


Jean-Pierre.