I have a text file containing one record per line which I'd like to sort alphabetically, except that I want '-' to sort after '[' and ']'. (The natural sort order has '-' before the square brackets.) Is there a way to modify the collation that sort(1) uses in order to achieve this?
|
feedback
|
|
One way would be to substitute a character that doesn't appear in your data, but sorts after the brackets (in some locale).
This is obviously not an ideal solution. | |||
|
feedback
|
|
You could do it with perl:
| |||||
feedback
|
|
You will probably want to apply one of the suggested workarounds, but the answer to your question is no(t easily). If you want to change how | |||
|
feedback
|