我正在尝试根据特定位置对文件进行排序,但这不起作用,这是数据和输出。
~/scratch$ cat id_researchers_2018_sample
id - 884209 , researchers - 1
id - 896781 , researchers - 4
id - 901026 , researchers - 15
id - 904091 , researchers - 1
id - 905525 , researchers - 1
id - 908660 , researchers - 5
id - 908876 , researchers - 7
id - 910480 , researchers - 10
id - 916197 , researchers - 1
~/scratch$ sort -k 28,5 id_researchers_2018_sample
id - 884209 , researchers - 1
id - 896781 , researchers - 4
id - 901026 , researchers - 15
id - 904091 , researchers - 1
id - 905525 , researchers - 1
id - 908660 , researchers - 5
id - 908876 , researchers - 7
id - 910480 , researchers - 10
id - 916197 , researchers - 1
我想按最后一列中的数字对其进行排序,如下所示:
id - 884209 , researchers - 1
id - 904091 , researchers - 1
id - 905525 , researchers - 1
id - 916197 , researchers - 1
id - 896781 , researchers - 4
id - 908660 , researchers - 5
id - 908876 , researchers - 7
id - 910480 , researchers - 10
id - 901026 , researchers - 15