![]() |
|
|
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 |
| count up file | waqar | Shell Programming and Scripting | 12 | 11-03-2008 07:18 PM |
| Count the distinct list of ids | jingi1234 | UNIX for Advanced & Expert Users | 2 | 10-24-2008 05:51 AM |
| Sorting using count, grep and count | sukhpal_78 | UNIX for Dummies Questions & Answers | 2 | 06-27-2008 01:13 AM |
| help me to count no of fields in a file | babu@shell | Shell Programming and Scripting | 7 | 10-31-2006 01:36 AM |
| How to count the record count in an EBCDIC file. | oracle8 | UNIX for Dummies Questions & Answers | 1 | 07-26-2006 08:22 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Getting Sum, Count and Distinct Count of a file
Hi all this is a UNIX question.
I have a large flat file with millions of records. col1|col2|col3 1|a|b 2|c|d 3|e|f 3|g|h footer**** I am supposed to calculate the sum of col1 1+2+3+3=9, count of col1 1,2,3,3=4, and distinct count of col1 1,2,3=c3 I would like it if you avoid external commands like AWK. Also, can we do the same by creating a function? Please bear in mind that the file is huge Thanks in advance Last edited by Franklin52; 02-28-2009 at 06:08 AM.. Reason: urls removed |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|