sort
에 대한 -k
옵션은 여러 번 나타날 수 있습니다. 시도 :
sort -t, -k6,6 -k4,4 inputfile
자세한 내용은 sort invocation을 참조하십시오.
> ‘-k pos1[,pos2]’
> ‘--key=pos1[,pos2]’
Specify a sort field that consists of the part of the line between pos1 and pos2 (or the end of the line, if pos2 is omitted), inclusive.
Each pos has the form ‘f[.c][opts]’, where f is the number of the field to use, and c is the number of the first character from the beginning of the field. Fields and character positions are numbered starting with 1; a character position of zero in pos2 indicates the field's last character. If ‘.c’ is omitted from pos1, it defaults to 1 (the beginning of the field); if omitted from pos2, it defaults to 0 (the end of the field). opts are ordering options, allowing individual keys to be sorted according to different rules; see below for details. Keys can span multiple fields.
Example: To sort on the second field, use --key=2,2 (-k 2,2). See below for more notes on keys and more examples. See also the --debug option to help determine the part of the line being used in the sort.
안녕하세요. stackoverflow에 오신 것을 환영합니다. 그렇다면 어떤 소프트웨어 또는 프로그래밍 언어에 대해 이야기하고 있습니까? –
그는 유닉스 정렬 도구에 대해 이야기하고 있습니다. – XapaJIaMnu
@phresnel unix/linux shell – SheetJS