当前位置:  技术问答>linux和unix

一个关于sort排序的问题,麻烦会的帮帮忙

    来源: 互联网  发布时间:2016-05-15

    本文导语:  commission_withhold_2,0,0.14,0.00,7,49541,0,24543587 commission_withhold_3,0,0.28,0.00,7,49541,0,24543588 commission_withhold_1,0,0.14,0.00,1,49531,0,24543572 commission_withhold_4,0,0.14,0.00,1,49531,0,24543589 commission_withhold_5,0,0.14,0.00,2,49521,0,24543590 commission_withhold_...

commission_withhold_2,0,0.14,0.00,7,49541,0,24543587
commission_withhold_3,0,0.28,0.00,7,49541,0,24543588
commission_withhold_1,0,0.14,0.00,1,49531,0,24543572
commission_withhold_4,0,0.14,0.00,1,49531,0,24543589
commission_withhold_5,0,0.14,0.00,2,49521,0,24543590
commission_withhold_6,0,0.14,0.00,1,49531,0,24543595
commission_withhold_7,0,0.14,0.00,3,49465,0,24543598
commission_withhold_8,0,0.14,0.00,1,49531,0,24543591
commission_withhold_9,0,0.14,0.00,1,49531,0,24543551
commission_withhold_10,0,0.14,0.00,1,49531,0,24543558
commission_withhold_11,0,0.14,0.00,1,49531,0,24543579


以上内容用sort排序 排序顺序按第一个(,)前边的数字排序。

|
给一个比较傻的方法。
假设当前目录test文件中保存了楼主的数据,使用下面的语句可以实现排序

cat test | awk -F'[_]' '{print $3}'|sort -g| awk '{printf("commission_withhold_%sn",$0);}'

输出结果为:
commission_withhold_1,0,0.14,0.00,1,49531,0,24543572 
commission_withhold_2,0,0.14,0.00,7,49541,0,24543587 
commission_withhold_3,0,0.28,0.00,7,49541,0,24543588 
commission_withhold_4,0,0.14,0.00,1,49531,0,24543589 
commission_withhold_5,0,0.14,0.00,2,49521,0,24543590 
commission_withhold_6,0,0.14,0.00,1,49531,0,24543595 
commission_withhold_7,0,0.14,0.00,3,49465,0,24543598 
commission_withhold_8,0,0.14,0.00,1,49531,0,24543591 
commission_withhold_9,0,0.14,0.00,1,49531,0,24543551 
commission_withhold_10,0,0.14,0.00,1,49531,0,24543558 
commission_withhold_11,0,0.14,0.00,1,49531,0,24543579 

    
 
 

您可能感兴趣的文章:

 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • C++ Lists(链表) 成员 sort():给list排序
  • ll 命令输出,使用sort排序问题
  • STL vector+sort排序和multiset/multimap排序比较
  • 可视化算法排序过程 Sound of Sorting
  • 请问怎么用sort对多个字段进行排序?
  • sort排序问题
  • jQuery排序工具 jQuery.sorted
  • linux中使用sort命令进行排序的问题
  • 用sort命令怎样按姓名字段排序?
  • sort命令做排序的效率如何???
  • Collections.sort()方法,已经实现Comparable接口,为什么无法将Vector排序?
  • sort 分栏排序
  • C++实现简单的希尔排序Shell Sort实例
  • java插入排序 Insert sort实例
  • PHP中的排序函数sort、asort、rsort、krsort、ksort区别分析
  • C#通过IComparable实现ListT.sort()排序
  • c#基数排序Radix sort的实现方法
  • Java冒泡排序(Bubble Sort)实例讲解
  • 100分求助Linux Sort对文件排序,很头痛,求帮助啊
  • C++ 关于STL中sort()对struct排序的方法
  • c# 冒泡排序算法(Bubble Sort) 附实例代码
  • java命名空间javax.swing.plaf.basic类basicdirectorymodel的类成员方法: sort定义及介绍
  • who>sort和who/sort有什么区别
  • java命名空间javax.swing.event枚举rowsorterevent.type的类成员方法: sort_order_changed定义及介绍
  • sort
  • java命名空间javax.swing类defaultrowsorter<m,i>的类成员方法: sort定义及介绍
  • stl SORT vector 内存翻倍
  • java命名空间javax.swing.event枚举rowsorterevent.type的类成员方法: sorted定义及介绍
  • 问一个关于sort命令的问题
  • java命名空间java.util类collections的类成员方法: sort定义及介绍
  • linux sort的用法


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3