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 -->
  #7 (permalink)  
Old 09-22-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,443
Quote:
Originally Posted by danmero View Post
What about..

Code:
awk '{a[$1]+=$2}END{for(i in a) print i, a[i]}' file1 file2 file3 .... fileX > output_file

Code:
awk '{a[$1 FS $2]+=$3}END{for(i in a) print i, a[i]}'  file1 file2 file3 .... fileX> output_file