[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort by hexadecimal number
From: |
Pádraig Brady |
Subject: |
Re: sort by hexadecimal number |
Date: |
Wed, 18 Nov 2020 14:04:43 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Thunderbird/83.0 |
On 17/11/2020 00:20, Chris Dunlop wrote:
Hi,
It would be useful to have 'sort' be able to sort by hexidecimal number.
This has been asked a few times.
Previously I noted on the list that:
-g supports hex, though has overhead in float conversion.
For example `sort -k2,2g` would sort on the second key if hex.
Note if the numbers are fixed width, or can be prepended
with 0 to a fixed width, and are of consistent case,
then you can use simple textual comparison to do the sort.
I'll apply the attached to make this clear in the info docs.
cheers,
Pádraig
sort-g-hex-doc.patch
Description: Text Data