所以我有一个名为match的数组,其中match[0] =
[2014-05-30 15:21:20,781] DEBUG [scheduler-4] (DiamondSchedulerRunner.java:41) Current node is not a manager of:publishEmail in tenant:0
[2014-05-30 15:21:20,781] DEBUG [scheduler-1] (DiamondSchedulerRunner.java:41) Current node is not a manager of:readEmail in tenant:0
[2014-06-11 10:18:51,370] ERROR [executorWithPoolSizeRange-5] (PushNotificationsServiceBean.java:140) cannot send notification: service Whaler is not available for user himanshu.taunk@hp.com on device Desktop.device.uuid813374
[2014-05-30 15:21:50,608] DEBUG [scheduler-3] (DiamondSchedulerProxy.java:96) Diamond Scheduler name:index Mode:TENANT_NODE runOnTenant:true split:true
[2014-05-30 15:21:50,624] DEBUG [scheduler-3] (DiamondSchedulerRunner.java:41) Current node is not a manager of:index in tenant:0
[2014-06-11 10:18:49,124] ERROR [executorWithPoolSizeRange-5] (PushNotificationsServiceBean.java:140) cannot send notification: service Whaler is not available for user himanshu.taunk@hp.com on device Desktop.device.uuid798084
[2014-05-30 15:21:50,780] DEBUG [scheduler-5] (DiamondSchedulerProxy.java:96) Diamond Scheduler name:snooze Mode:TENANT_NODE runOnTenant:true split:true
[2014-05-30 15:21:50,780] DEBUG [scheduler-5] (DiamondSchedulerRunner.java:41) Current node is not a manager of:snooze in tenant:0
[2014-05-30 15:21:50,796] ERROR [scheduler-4] (DiamondSchedulerProxy.java:96) Diamond Scheduler name:publishEmail Mode:TENANT_NODE runOnTenant:true split:true match[1]是时间戳,match[2]是状态,match[3]是线程名,依此类推。有没有什么办法可以颠倒第一个索引中的元素,match[0],使得第一行成为最后一行,反之亦然,而不会扰乱其他索引?
更好的是,我可以逐行读取第一个索引到另一个数组中,然后反转后一个数组吗?
发布于 2014-06-17 07:25:09
你能用分隔符拆分匹配,\n然后反转并加入吗?即
match[0] = match[0].split('\n').reverse().join('\n')https://stackoverflow.com/questions/24250551
复制相似问题