Suppose you have the following data, separated by a space for the data column:
1 Hevichuan 124.63 172 0.722 Zhang Ziyin 99.67 172 0.583 Week Guang bin 93.34 188 0.504 Chen Xingdong 41.86 188 0.225   ; She Yongchen 26.68 188 0.146 Teo Eng Hock 18.25 188 0.107 Li Huatian 18.25 188 0.108 Ge Xiang Camp 11.89 164 0.079 Wang Tianmin &NB Sp -16.55 156 -0.1110 Liu Feng -16.19 -0.1111 Cattaneo hillock -86.73 &N Bsp -0.5712 Yang June -213.45 152 -1.40 If we want to sort by the 4th column of data, we can do so in vim: 1,12!sort-r-N- K4.1,5 -r is a descending sort-n is sorted by numeric size-K, which is sorted according to that field, 4.1, indicates the first character of the 4th column starts, 5 means to the 5th field ending-T followed by a delimiter, the default is a space run after data as follows: 7 Li Huatian 18.25 188 0.106 Teo Eng Hock 18.25 188 0.105 She Yongchen &nbs P 26.68 188 0.144 Chen Xingdong 41.86 188 0.223 Zhou Guangma 93.34 &NBS P 188 0.502 Zhang Ziyin 99.67 172 0.581 Hevichuan 124.63 172 0.728 Ge Xiang Camp 11.89 164 0.079 Wang Tianmin -16.55 156 -0 .1112 Yang June -213.45 152 -1.4011 Cattaneo hillock -86.73 -0.5710 Liu Feng -16.19 $ -0.11 from: http://blog.sina.com.cn/s/blog_4b1816550100k2ec.html
Vim sorts files by field