如何通過asc或desc命令從特定列的日期和時間或僅日期列重新排序文件。如何通過特定列的asc或desc命令重新排序文件
{"hostname":"sg2","role":"epay","eventid":"ALERT_ORACLE","date":"02/08/2011","time":"01:30:00"},
{"hostname":"sg1","role":"pay","eventid":"ALERT_DF","date":"11/24/2010","time":"19:33:01"},
{"hostname":"sg3","role":"ipay","eventid":"ALERT_SMF","date":"12/11/2012","time":"02:30:00"},
通常用「之類的-gk(列數)」,在這種情況下,不能夠趕上日期和時間列或僅日期,也許是需要一些分隔字符串或相關。
Expetected的看法是:
{"hostname":"sg1","role":"pay","eventid":"ALERT_DF","date":"11/24/2010","time":"19:33:01"},
{"hostname":"sg2","role":"epay","eventid":"ALERT_ORACLE","date":"02/08/2011","time":"01:30:00"},
{"hostname":"sg3","role":"ipay","eventid":"ALERT_SMF","date":"12/11/2012","time":"02:30:00"},
很好的例子,那就是我需要的,謝謝 –