## Print the key with highest value

Print the key with highest value
# 1
03-13-2012
Print the key with highest value

print the key with highest value

input
output
 quincyjones View Public Profile for quincyjones Find all posts by quincyjones
# 2
03-13-2012
This User Gave Thanks to complex.invoke For This Post:
 complex.invoke View Public Profile for complex.invoke Find all posts by complex.invoke
# 3
03-13-2012
Thanx. Can you also modify it so that it can print the max if the value is positive and minimum if the value is negative ?

Fr ex:
 quincyjones View Public Profile for quincyjones Find all posts by quincyjones
# 4
03-13-2012
or

 complex.invoke View Public Profile for complex.invoke Find all posts by complex.invoke
# 5
03-13-2012
Assuming that for a \$1 value, all \$2 value have the same sign :

 ctsgnb View Public Profile for ctsgnb Find all posts by ctsgnb
# 6
03-13-2012
So then is -4 higher than 3?

@huaihuaiz3: that second solution will probably not work reliably. Just try adding an extra space between field 1 and 2 on one of the lines and see what happens to the sort..
 Scrutinizer View Public Profile for Scrutinizer Find all posts by Scrutinizer
# 7
03-14-2012
Is it possible to sum the values instead of taking higher value ?

 quincyjones View Public Profile for quincyjones Find all posts by quincyjones

## awk print line with highest value

grepping on a value but then want to print only those lines that have the highest value in the 4th column log text text R59FJ log text text R63FT log text text R60JX log1 text text R63EA log1 text text R60JX desired output log text text R63FT log1 text text R63EAtried this but not getting...

## Print whole line with highest value from one column

Hi, I have a little issue right now. I have a file with 4 columns test0000002,10030010330,c_,218 test0000002,10030010330,d_,202 test0000002,10030010330,b_,193 test0000002,10030010020,c_,178 test0000002,10030010020,b_,170 test0000002,10030010330,a_,166 test0000002,10030010020,a_,151...

## Print whole line with highest value from one column

Hi, I have a little issue right now. I have a file with 4 columns test0000002,10030010330,c_,218 test0000002,10030010330,d_,202 test0000002,10030010330,b_,193 test0000002,10030010020,c_,178 test0000002,10030010020,b_,170 test0000002,10030010330,a_,166 test0000002,10030010020,a_,151...

## HHow to print the group with a highest value within a set

How to print the names with a highest value within a set and filter if it is the only unique group within the same set input sets names value groups j007 shot1 0.6 a j007 shot2 0.5 b j007 shot3 0.4 bb j007 shot4 0.3 bc j007 shot5 0.2 ...

## Need to print duplicate row along with highest version of original

There are some duplicate field on description column .I want to print duplicate row along with highest version of number and corresponding description column. file1.txt number Description === ============ 34567 nl21a00is-centerdb001:ncdbareq:Error in loading init 34577 ...

## Only print the entries with the highest number?

Just want to say this is great resources for all thing Unix!! cat tmp.txt A 3 C 19 A 2 B 5 A 1 A 0 C 13 B 9 C 1 Desired output: A 3 B 9 C 19 The following work but I am wondering if there is a better way to do it:

## Print line based on highest value of col (B) and repetion of values in col (A)

Hello everyone, I am writing a script to process data from the ATP world tour. I have a file which contains: t=540 y=2011 r=1 p=N409 t=540 y=2011 r=2 p=N409 t=540 y=2011 r=3 p=N409 t=540 y=2011 r=4 p=N409 t=520 y=2011 r=1 p=N409 t=520 y=2011 r=2 p=N409 t=520 y=2011 r=3 p=N409 The...

## Print line with highest value from one column

Hi everyone, This is my first post, but I have already received a lot of help from the forums in the past. Thanks! I've searched the forums and my question is very similar to an earlier post entitled "Printing highest value from one column", which I am apparently not yet allowed to post a...

## Print line with highest value from one column

Hi everyone, This is my first post, but I have already received a lot of help from the forums in the past. Thanks! I've searched the forums and my question is very similar to an earlier post entitled "Printing highest value from one column", which I am apparently not yet allowed to post a...

. . . . . .