如何获取数据中的最大日期时间值并获取相应的数据

时间:2016-02-15 11:43:26

标签: datetime max

输入如下:

9999993612,10/Feb/2016:19:04:16
9999993612,10/Feb/2016:19:04:15
9999993612,10/Feb/2016:19:04:09
9999993612,10/Feb/2016:01:31:47
9999993612,10/Feb/2016:01:31:46
9999993612,10/Feb/2016:01:31:43

我们需要输出。

9999993612,10/Feb/2016:19:04:16

使用linux命令。

1 个答案:

答案 0 :(得分:0)

****工作正常**********

awk'BEGIN {FS =“,”;打印“NO time”} NR!= 1 {a [$ 1] ++; b [$ 1] = $ 2} END {for(i in a)printf(“%s%s \ n”,i,b [i] )''FILENAME