awk 数组排序-- asort 与 asorti
78 90
23 45
34
45
90
转自:http://blog.chinaunix.net/uid-21374062-id-3189744.html
一个统计文件大小并排序的脚本:
ls -l | gawk '{ if(NR!=1){array[$5]=$9;} } END { n=asorti(array,dest); for(i=1;i<=n;i++) print dest[i],array[dest[i]];
} '
1040 test_uuid.py
241 test_fun.pyc
43 test_os.py
58 test_fun.py
awk 数组排序-- asort 与 asorti的更多相关文章
- 022-PHP数组排序asort
<?php // 构造一个数组变量 $users = array("bob" => "Yobert", "steve" => ...
- 【三剑客】awk命令2
1. 程序结构: Begin 和 End模块 awk的程序的结构:Begin块,Body块,End块. BEGIN块:BEGIN {awk-commands} BEGIN块在被程序启动时启动,且只执行 ...
- 十五 awk文本处理
Awk 语法和基础命令 以行为处理单位 对数据进行逐行处理 处理完当前行,把当前行的处理结果输出后自动对下一行进行处理 直到文件中所有行处理完为止 创造者:Aho.Weinberger.Kernigh ...
- awk - Unix, Linux Command---reference
http://www.tutorialspoint.com/unix_commands/awk.htm NAME gawk - pattern scanning and processing lang ...
- awk overview
VARIABLES, RECORDS AND FIELDS AWK variables are dynamic; they come into existence when they are fir ...
- vim grep sed awk对大小写不敏感
vim grep sed awk对大小写不敏感 环境 [root@osker ~]# cat /etc/redhat-release CentOS Linux release (Core) [root ...
- 《awk中文手册》-本人参考官方手册翻译
01. 简介 AWK是一个文本(面向行和列)处理工具,同时它也是一门脚本语言. AWK其名称得自于它的创始人 Alfred Aho .Peter Weinberger 和 Brian Kernigha ...
- ***PHP 数组排序 +php二维数组排序方法(PHP比较器)
PHP - 一维数组的排序函数 在本节中,我们将学习如下 PHP 数组排序函数: sort() - 以升序对数组排序 rsort() - 以降序对数组排序 asort() - 根据值,以升序对关联数组 ...
- PHP 数组排序
数组中的元素能够以字母或数字顺序进行升序或降序排序. PHP - 数组的排序函数 在本节中,我们将学习如下 PHP 数组排序函数: sort() - 以升序对数组排序 rsort() - 以降序对数组 ...
随机推荐
- 域名、网站名、url的定义
网址:http://jingyan.baidu.com/article/2c8c281df0afd00008252aa7.html
- 使用纯css3实现图片轮播
<!DOCTYPE html> <html> <head> <title> 飛天网事--纯CSS代码实现图片轮播 </title> < ...
- tomcat下同时部署两个项目不能正常启动的问题
在部署两个项目,这两个项目都是采用了一个框架,只是业务系统进行了修改.部署的时候发现启动有问题.会报类似下边的错误 Web app root system property already set t ...
- 插件管理工具 Alcatraz
Alcatraz 安装: https://github.com/alcatraz/Alcatraz Github官网链接 终端安装方法 mkdir -p ~/Library/Application\ ...
- Python基础篇-day4
本节目录: 1.字符编码 2.函数 2.1参数 2.2变量 2.3返回值 2.4递归 2.5 编程范式 2.6 高阶函数 *************************************** ...
- json处理三部曲之第二曲:利用Jackson处理json
利用Jackson处理json需要导入的jar包(2以上版本的): <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.c ...
- CSS问题:怎么样让鼠标经过按钮的时候发生的状态一直停留在当页呢?
$('p').mouseenter(function(){ $('p').css('background-color','yellow'); }); 只写一个mouseenter的动态效果的话是不能达 ...
- 二〇一五年五月二十二日--bug--启动页面出现模糊的问题
启动页面出现模糊的问题: 原因是 :android:theme="@style/TranslucentTheme" <application android:name=&qu ...
- ListView间隔设置颜色
在Adapter的getView中 if (position % 2 == 0) holder.shoucangbt.setBackgroundColor( Color.rgb(246, 246, 2 ...
- C相关的图书(链接不可用)
Visual C++视频技术方案宝典.pdf: http://www.t00y.com/file/17628500 Windows 图形编程.pdf: http://www.t00y.com/file ...