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 07-17-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
Quote:
Originally Posted by Franklin52 View Post
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
You Rock, that works great...

A couple questions...
Im still learing awk... Can you explain how this works.. What its doing so I dont have to ask about other scripts in the future and I can help others more.

really appreciate it.