![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count of matched pattern occurance | palash2k | UNIX for Dummies Questions & Answers | 3 | 04-24-2008 12:33 PM |
| SED Search Pattern and Replace with the Pattern | racbern | Shell Programming and Scripting | 4 | 03-15-2008 01:59 AM |
| How to count pattern in column | ahjiefreak | Shell Programming and Scripting | 12 | 12-04-2007 03:53 PM |
| count the number chracters occurances in a line | skyineyes | Shell Programming and Scripting | 6 | 06-26-2007 06:09 AM |
| Search file for pattern and grab some lines before pattern | frustrated1 | Shell Programming and Scripting | 2 | 12-22-2005 11:41 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
nawk-how count the number of occurances of a pattern, when don't know the pattern
I've written a script to count the total size of SAN storage LUNs, and also display the LUN sizes.
From server to server, the LUNs sizes differ. What I want to do is count the occurances as they occur and change. These are the LUN sizes: 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95 55.96 55.96 49.99 49.99 49.99 49.99 49.99 49.99 49.99 49.99 49.99 The above would produce something like this: 17x49.95, 2x55.96, 9x49.99 2nd example data file 27.96 27.96 27.96 27.96 27.96 27.96 27.96 13.95 2.95 2.95 142.99 142.99 142.99 142.99 142.99 142.99 142.99 produces 7x27.96, 1x13.95, 2x2.95, 7x142.99 I'm trying to find a way to do this with nawk. |
| Forum Sponsor | ||
|
|