![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| du total | C3000 | UNIX for Dummies Questions & Answers | 9 | 12-05-2008 11:04 AM |
| total occ. | gander_ss | Shell Programming and Scripting | 6 | 05-09-2008 04:54 AM |
| grep running total/ final total across multiple files | MrAd | UNIX for Dummies Questions & Answers | 5 | 05-08-2007 02:03 PM |
| How to calculate with awk | whatisthis | Shell Programming and Scripting | 4 | 11-09-2005 12:39 PM |
| Total ram | orca | UNIX for Dummies Questions & Answers | 4 | 04-25-2002 08:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Awk help needed to calculate total
Hi all,
I have a flat file like 10 steven 25 mike 47 Charles 127 Nancy 34 steven 23 mike 67 Charles 7761 Nancy 8 steven 54 mike 88 Charles 1267 Nancy I need to calculate the total of steven and all the members , for this I am using like grep "`sed -n 1p patterns.txt`" temp.log | awk '{x+=$1}END{print "Total "x}' where patterns.txt contains steven mike Charles Nancy I think i'm using wrong method, is there any other method is available which can do this job very easily. Regards, senthilkumar ak |
![]() |
| Bookmarks |
| Tags |
| awk calculation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|