michael_hartman_cz

FIT SKJ cashmax v2

Jun 24th, 2014
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.31 KB | None | 0 0
  1. #!/bin/awk -f
  2. NF==2 && $2 ~ /^(0|-?([1-9][0-9]*|0)(\.[0-9]*)?)$/{
  3.     pole[$1]=pole[$1]+$2
  4.     l=$1
  5. }
  6. END {
  7.     max=pole[l]
  8.     for (i in pole)
  9.         if (max<pole[i])
  10.             max=pole[i]
  11.    
  12.     n=asorti(pole,arr)
  13.     for (i=0;i<=n;i++)
  14.         if (max==pole[arr[i]] && max !="")
  15.             print arr[i],pole[arr[i]]
  16.     exit 0    
  17. }
Advertisement
Add Comment
Please, Sign In to add comment