The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
awk - sort, then print the high value for each group
.
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
:
awk - sort, then print the high value for each group
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
02-11-2009
gio001
Registered User
Join Date: Mar 2007
Posts: 70
How about this .....
awk '{print $2" "$1}' file_in_input | sort -k 2 -k 1rn | uniq -f 1 |awk '{print $2" "$1}' >output_file
Hope this is what you needed.
G.
gio001
View Public Profile
Find all posts by gio001
Find gio001's past nominations received
Find gio001's present nominations given