给一个文件里的内容按规则排序

Posted 鹿慕叶

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了给一个文件里的内容按规则排序相关的知识,希望对你有一定的参考价值。

report.txt文件里有以下内容:记录了一些方法的执行时间,要求按执行时间降序排列。

void com.dustpan.zeus.core.service.MergeService.startService(int)|2
void com.dustpan.zeus.core.service.InitShopDateService.startService(int)|1
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|475
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|96
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|1013
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|184
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|729
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|14
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|394
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|90
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|569
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|796
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|1648
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|82
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|1018
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|14
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|937
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|17
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|601
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|52
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|5081
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|388
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|198
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|11
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|203
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|11
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|241
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|13
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|176
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|12
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|206
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|33
boolean com.dustpan.zeus.core.service.MergeService.executeGePrintSyncTask()|242
boolean com.dustpan.zeus.core.service.InitShopDateService.executeInitShopTask()|19

 

以上是关于给一个文件里的内容按规则排序的主要内容,如果未能解决你的问题,请参考以下文章

文件怎么设置手动排序?

JAVA中List集合的汉字排序

DOS按规则批量重命名所有(子)目录下文件

[教你做小游戏] 展示斗地主扑克牌,支持按出牌规则排序!支持按大小排序!

stl-优先队列

如何让 Map 中的值按放入顺序输出