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,345
Try this:

Code:
awk 'BEGIN{FS=OFS=","}
NR==FNR{a[$6]=$0;sub(","$6,"",a[$6]);next}
a[$2]{$0=$0 FS a[$2]}{print}' File2 File1

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

Regards