How to find max value in a tabular data?

FILE_NAME VER TYPE DELETED_DATE CREATED_DATE SIZE LOCATION
hello 1 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/
hello 2 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/
hello 3 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/
hello 4 d 2010-08-09 2010-08-09 4096 /home/xxxxx/project/

hi there I have got the above table I am trying to find a row with the maximum version number

what is the best way of doing it

so basically if I run the script I should get the maximum value as 4
Please advice

PS: the delimeter in above table is TAB

 sed -n '2,${s/^.[^\t]*[ \t]//;s/[ \t].*//p}' file|sort -n | tail -1 

Hi

sort -k2nr,2 file | awk '{print $2;exit}'

Guru.

another way

cut -f2 file | sort -n | tail -1

It can be done using just awk:

awk 'BEGIN {max = 0} {if ($2 > max) { max=$2; row=$0;} } END {print row}' infile