How do I sort a list by a word that appears multiple times in it? #8053
Answered
by
David-Else
David-Else
asked this question in
General
-
The new todo.txt #7835 format auto sorts on save alphabetically, but I also want the option to sort by via the
How can I sort so all the |
Beta Was this translation helpful? Give feedback.
Answered by
David-Else
Aug 24, 2023
Replies: 1 comment 6 replies
-
the sorting on save is done using the UNIX sort program so you need to look at the manual for UNIX sort. alternatively you can simply write your own little program (small rust/go binary or a python script for example) to sort stdin however you want (and output back to stdout) |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cheers! The answer is to actually sort via
@
and+
instead, best results :)The -t option is used to specify the field separator character. It allows you to define a custom delimiter character to separate fields in the input file. By default, sort uses whitespace as the field separator. With the -t option, you can specify a different character to be used as the field separator.
In Unix sort, the "-k2" option is used to specify the key field for sorting. It indicates that the sorting should be done based on the second field (column) of the input.