m*********y 发帖数: 127 | 1 Sort a CSV file which have exactly four numbers in each row.
Sort on the basis first number of the row. In case first digit is same, look
for the second digit. If required, look for the 3rd or 4th number.
Sample input:
1,3,6,7
-3,2,7,8
1,1,6,7
8,-3,5,4
-3,2,7,7
…..
….
…
Output:
-3,2,7,7
-3,2,7,8
1,1,6,7
1,3,6,7
8,-3,5,4 | P********e 发帖数: 2610 | 2 简单方法就是用excel打开,sort
写程序就按string读进来sort
look
【在 m*********y 的大作中提到】 : Sort a CSV file which have exactly four numbers in each row. : Sort on the basis first number of the row. In case first digit is same, look : for the second digit. If required, look for the 3rd or 4th number. : Sample input: : 1,3,6,7 : -3,2,7,8 : 1,1,6,7 : 8,-3,5,4 : -3,2,7,7 : …..
| w****i 发帖数: 964 | 3 in linux, sort --stable for each column |
|