使用linux sort给一个文件里的内容按规则排序
任务: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
report.txt
使用linux sort给一个文件里的内容按规则排序的更多相关文章
- linux怎么模糊查找一个文件
linux如何模糊查找一个文件 在当前目录下搜索指定文件: find . -name test.txt 在当前目录下模糊搜索文件: find . -name '*.txt' 在当前目录下搜索特定属性的 ...
- shell统计一个文件里某行出现的次数并排序
话说有个aaa.txt文件,文件内容如下: aaaabbbbccccddddeeeeffffmmmmooooaaaaccccaaaabbbbddddaaaammmmbbbbaaaaoooo 然后面试题 ...
- linux 如何显示一个文件的某几行(中间几行)
linux 如何显示一个文件的某几行(中间几行) [一]从第3000行开始,显示1000行.即显示3000~3999行 cat filename | tail -n +3000 | head -n 1 ...
- 【转载】在Linux下,一个文件也有三种时间,分别是:访问时间、修改时间、状态改动时间
在windows下,一个文件有:创建时间.修改时间.访问时间.而在Linux下,一个文件也有三种时间,分别是:访问时间.修改时间.状态改动时间. 两者有此不同,在Linux下没有创建时间的概念,也就是 ...
- Linux中一个文件10行内容,如何输出5-8内容到屏幕
题目是这样的,Linux中一个文件10行内容,如何输出5-8内容到屏幕首先我们模拟一下这样的环境: [root@localhost question]# pwd /root/question [roo ...
- Windows cmd 将命令(/指令)写到一个文件里,直接运行这个文件。提高工作效率
Windows cmd 批处理(cmd/bat)文件的简单使用介绍 前言 如果你想我一样,要每天都需要在cmd上,用键盘去敲击相同的命令,时间一长,你就觉得很无聊.有没有什么比较高效的方法,让我们不用 ...
- Linux 如何查看一个文件夹下面有多少个文件
Linux 如何查看一个文件夹下面有多少个文件 $ tree $ find ./ -type f | wc -l $ ls -l | grep "^-" | wc -l refs ...
- java中的文件读取和文件写出:如何从一个文件中获取内容以及如何向一个文件中写入内容
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.Fi ...
- Flex读取txt文件里的内容(二)
Flex读取txt文件里的内容 自己主动生成的文件 LoadTxt-app.xml: <?xml version="1.0" encoding="utf-8&quo ...
随机推荐
- 通过DNS传输后门来绕过杀软
前言 在本篇文章里,我想解释怎么样不使用加密数据的方法也能绕过杀软,同时我也想在github上分享源代码.https://github.com/DamonMohammadbagher/NativePa ...
- 微信公众号开发《三》微信JS-SDK之地理位置的获取,集成百度地图实现在线地图搜索
本次讲解微信开发第三篇:获取用户地址位置信息,是非常常用的功能,特别是服务行业公众号,尤为需要该功能,本次讲解的就是如何调用微信JS-SDK接口,获取用户位置信息,并结合百度地铁,实现在线地图搜索,与 ...
- 接口测试-jmeter
一.jmeter下载安装 1)安装jdk(见博文<windows上安装jdk>) 2)在jmeter官网下载 http://jmeter.apache.org/download_jmet ...
- 【WPF】三维模型中的“照相机”
WPF 部分支持三维模型,为啥说是部分支持?毕竟 WPF 的侧重点还是在应用开发上,虽然也有些游戏是用 WPF 开发的,不过,老周想啊,如果真要开发游戏,最好用专门的框架,WPF 应当用于开发应用功能 ...
- 详谈JAVA中的file类与IO流
File类 位置于java.io包构造方法:File(String parent, String child)new file("d:\\","a.txt") ...
- jsp的自定义标签 控制jsp内容显示
引入方式示例 <%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %> tld文件 <?x ...
- 开涛spring3(6.2) - AOP 之 6.2 AOP的HelloWorld
6.2.1 准备环境 首先准备开发需要的jar包 org.springframework.aop-3.0.5.RELEASE.jar com.springsource.org.aspectj.w ...
- VueJs生产环境部署
VueJs为客户端语言,所以部署的时候是不需要基于nodejs或其他服务器运行环境,只需要像其他静态站点的方式发布就可以了,下面介绍一下VueJs具体发布的流程还有需要注意的点. 先来看VueJs最终 ...
- linux压缩及vi操作
一:Linux的压缩方式 1.tar cvf 对文件进行压缩,tar cvf+压缩文件完成的命名+需要压缩的文件 2,tar -tf +命名的压缩文件:表示查看目录里面的内容 3,tar -xf 解压 ...
- Django框架全面讲解
Python的WEB框架有Django.Tornado.Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM.模型绑定.模板引擎.缓存.Session等诸多功能. ...