由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - sort problem
相关主题
How to do that using "sort" command?Re: How to make PDF file?
请问几个关于Sed的问题how to run background process after logout
[转载] Hidden character in a file怎么弄出彩色的xterm?
HELP: How to get rid of unwanted characters in file name如何判断一个文件或命令的版本?
solaris 9/10 ld.so local root shell bug?
A question about show diff on vim可有好的UNIX,LINUX,X-WINDOWS...书推荐。
Perl: hash numerical sorthOW CAN i COMPILE AND RUN FORTRAN?
question about temperay file in sort commandwhat's the difference between .a and .so,
相关话题的讨论汇总
话题: sort话题: ab话题: 11话题: aa话题: 119k118
进入Unix版参与讨论
1 (共1页)
T***B
发帖数: 137
1
15 AA-1 119k118
13 BB-8 119k24
13 AB-4 22as149
11 BC-4 22as90
11 BA-1 16pk187
11 AB-1 16pk246
I need to sort the above text this way:
sort according to the first 4 characters in the
3rd column( like 119k, 12as );
then sort according to the number beginning from
the 5th character in the 3rd column (that is,
sort numerically).
the output should be:
13 BB-8 119k24
15 AA-1 119k118
11 BA-1 16pk187
11 AB-1 16pk246
11 BC-4 22as90
13 AB-4 2
X****r
发帖数: 3557
2
sort -n -b -k3.5 | sort -s -b -k3.1,3.4
( GNU sort 2.0.21 )

【在 T***B 的大作中提到】
: 15 AA-1 119k118
: 13 BB-8 119k24
: 13 AB-4 22as149
: 11 BC-4 22as90
: 11 BA-1 16pk187
: 11 AB-1 16pk246
: I need to sort the above text this way:
: sort according to the first 4 characters in the
: 3rd column( like 119k, 12as );
: then sort according to the number beginning from

1 (共1页)
进入Unix版参与讨论
相关主题
what's the difference between .a and .so,solaris 9/10 ld.so local root shell bug
How to creat .tar.gz?A question about show diff on vim
UNIX下的DLL编程Perl: hash numerical sort
[急!] Shell Programming求救question about temperay file in sort command
How to do that using "sort" command?Re: How to make PDF file?
请问几个关于Sed的问题how to run background process after logout
[转载] Hidden character in a file怎么弄出彩色的xterm?
HELP: How to get rid of unwanted characters in file name如何判断一个文件或命令的版本?
相关话题的讨论汇总
话题: sort话题: ab话题: 11话题: aa话题: 119k118