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 02-10-2009
angheloko's Avatar
angheloko angheloko is offline
Registered User
  
 

Join Date: Jul 2008
Location: Philippines
Posts: 125
Hope this helps:

Code:
cut -f1 -d"," file1 > keys
cut -f1 -d"," file2 >> keys
sort keys | uniq -ud | while read X; do
	echo "$X,"`sed -n "/^$X/p" file1 | cut -f2 -d","`","`sed -n "/^$X/p" file2 | cut -f2 -d","`
done