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 -->
#
4
(
permalink
)
02-11-2009
vgersh99
Moderator
Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Quote:
Originally Posted by
gio001
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.
way too many unnecessary 'pipes' for
my
taste....
vgersh99
View Public Profile
Find all posts by vgersh99
Find vgersh99's past nominations received
Find vgersh99's present nominations given