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

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

时间: 2024-08-04 22:15:19

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

shell 练习题02 一个文件里将内容三行显示为一行

要求: 一个文件里将内容三行显示为一行 思路:是将第二行的内容,第三行的内容依次附加到第一行中,这样三行的内容就能变为一行,如果不够三行自动融为一行,具体如下 [[email protected] shell]# cat /tmp/chy.txt  1 2 3 4 g 6 8 (查看chy.txt的内容) [[email protected] shell]# vim yihang.sh #!/bin/bash #this is san hang bian wei yi hang sed 'N;N

第一个go的web程序;调用七牛云存储的音频api问题解决;条件搜寻文件里的内容

package main import ( "html/template" "io" "io/ioutil" "log" "net/http" "os" "path" "runtime/debug" ) const ( ListDir      = 0x0001 UPLOAD_DIR   = "./uploads" TEMPLA

创建日志文件并在该文件里添加内容

'创建日志文件并在该文件里添加内容 Sub writelog(log) Const forreading =1,forwriting =2,foraddpending=8 Dim fso,f Dim filepath filepath ="C:\log\log.txt" Set fso =createobject("scripting.filesystemobject") If fso.FileExists(filepath) = false Then Set f

如何在Eclipse里,有什么快捷的替换方法。把上百个jsp文件里的内容替换掉

ctrl + h 如何在Eclipse里,有什么快捷的替换方法.把上百个jsp文件里的内容替换掉,布布扣,bubuko.com

Flex读取txt文件里的内容报错

Flex读取txt文件里的内容 1.详细错误例如以下 2.错误原因 读取文件不存在 var file:File = new File(File.applicationDirectory.nativePath+"/phone.txt"); 3.解决的方法 将文件导入进去

Java IO把一个文件中的内容以字符串的形式读出来

代码记录(备查): /** * 把一个文件中的内容以字符串的形式读出来 * * @author zhipengs * */ public class FileToString { public static void main(String[] args) { System.out.println(readFileToString()); } private static String readFileToString() { // new 一个空文件,用于获取路径 File dirs = ne

java中的文件读取和文件写出:如何从一个文件中获取内容以及如何向一个文件中写入内容

1 2 3 import java.io.BufferedReader; 4 import java.io.BufferedWriter; 5 import java.io.File; 6 import java.io.FileInputStream; 7 import java.io.FileNotFoundException; 8 import java.io.FileOutputStream; 9 import java.io.IOException; 10 import java.io.

Flex读取txt文件里的内容(二)

Flex读取txt文件里的内容 自己主动生成的文件 LoadTxt-app.xml: <?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/1.5.3"> <!-- Adobe AIR Application Descriptor

Linux中一个文件10行内容,如何输出5-8内容到屏幕

题目是这样的,Linux中一个文件10行内容,如何输出5-8内容到屏幕首先我们模拟一下这样的环境: [root@localhost question]# pwd /root/question [root@localhost question]# seq 1 10 > q.txt [root@localhost question]# cat q.txt 1 2 3 4 5 6 7 8 9 10 我们的任务是取5-8行输出: 第一种方法: [root@localhost question]# sed