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 -->
  #2 (permalink)  
Old 07-17-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,346
If you have the first output in file1 and the second output in file2:


Code:
awk '
NR==FNR{split($2,s,"/");i=s[2];a[i]=$3;next}
a[$7]{$0=$0 FS a[$7]}
{print}
' file2 file1

If you get errors use nawk, gawk or /usr/xpg4/bin/awk on Solaris.

Regards