The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
array problem
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
array problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
02-10-2007
tayyabq8
Moderator
Join Date: Nov 2004
Location: Bahrain
Posts: 579
As per your sample output, you need count of second field not the third one, try this:
Code:
awk -F"|" '{ freq[$2]++ } END { for (word in freq) printf "%s\t%d\n", word, freq[word] }' data
tayyabq8
View Public Profile
Find all posts by tayyabq8
Find tayyabq8's past nominations received
Find tayyabq8's present nominations given