The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-02-2008
mohan705 mohan705 is offline
Registered User
 

Join Date: Feb 2007
Posts: 91
sum of more than 1 column

Hi

I want to sum of 3 columns in file.

Example: I want to sum of 3 ,6,8 th columns in file(SUM(3,6,8)).

Using awk can sum of single column

awk '{a+=$3} END {printf ("%f\n",a)' file_name

Thanks inadvance
MR
Reply With Quote
Forum Sponsor