65 20150427 000000000
8 20120930 000000000
18 20130626 000000000
6 20140505 000000000
1 20150603 000000000
18 20140712 000000000
65 20150502 000000000
10 20150113 000000000
92 20140707 000001000
20 20130530 000000000
11 20141231 000000000
15 20140516 000000000
1 20150523 000000000
18 20130620 120014000
7 20140505 000000000
Above is the file. First col is the uniq id followed by date & time. Whenever i am running the below query am not getting the desired result...
awk '{a[$1]=$1}END{for(i in a) print i,a[i]}' file
it is showing the random date but i want the latest date to be displayed against each uniq with no repetition. Please suggest a way forward.
You can use this awk instead: