我有一个名为 a.csv 的文件。其中包含
100008,3
10000,3
100010,5
100010,4
10001,6
100021,7
运行此命令后sort -k1 -d -t "," a.csv
结果是
10000,3
100008,3
100010,4
100010,5
10001,6
100021,7
这是出乎意料的,因为10001 should come first than 100010
试图理解为什么这会发生很久。但无法得到任何答案。
$ sort --version
sort (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.