12-23-2008
24,
0
Join Date: Dec 2008
Last Activity: 18 February 2009, 6:01 AM EST
Posts: 24
Thanks Given: 0
Thanked 0 Times in 0 Posts
try this
cat file
2 a b c
2 g h i
3 l k m
3 o p a
4 r t f
awk '{print $1}' file | sort -u | while read line; do grep ^$line file | tail -1 ; done
2 g h i
3 o p a
4 r t f
this will works even the first feild is not a digit
Last edited by reddyrajal; 12-23-2008 at 04:49 AM..