The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to pick values from column based on key values by usin AWK repinementer Shell Programming and Scripting 16 07-24-2009 09:59 AM
how to read the column and print the values under that column gemini106 Shell Programming and Scripting 6 03-28-2008 07:05 AM
How to check Null values in a file column by column if columns are Not NULLs Mandab Shell Programming and Scripting 7 03-15-2008 09:57 AM
summing according to the column ramky79 UNIX for Dummies Questions & Answers 2 02-28-2008 04:51 PM
Summing on column sbasetty Shell Programming and Scripting 2 02-07-2007 08:15 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-24-2009
mohsin.quazi mohsin.quazi is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 13
summing values of a column

I have a file which contains data as below:

Code:
-----------------------------------------------------------------------------------------------
                      GSPWeb Statistics for the period of last 20 days
-----------------------------------------------------------------------------------------------
  NBKID                 PAGE ACCESSED                                   PAGE COUNT
-----------------------------------------------------------------------------------------------
nbk1j7o              RMBS -> RMBSHome                                           1
nbk1j7o              RMBS -> TradingStrategy                                    1
nbk2coz              GSF -> GSFHome                                             1
nbk2coz              RMBS -> AgencyCMO                                          1
nbk2coz              RMBS -> PassThrough                                      102
nbk2coz              RMBS -> Prepayment                                       135
nbk2coz              RMBS -> RMBSHome                                           5
nbk2coz              RMBS -> TradingStrategy                                    6
nbk2gdl              GSF -> GSFHome                                           293
nbk2mcs              RMBS -> TradingStrategy                                    1
nbk2mfb              RMBS -> RMBSHome                                          41
nbk2w2w              GSF -> GSFHome                                             1
I want to find the sum of values in third column grouping by RMBS, GSF.

For example output should contain:

Code:
 
Total RMBS = 293
Total GSF = 295
This is part of a big project with lots of efforts I have reached this stage, was little stuck, awk command should help, but dont know how.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0