Not as great a solution as I hoped for - this one is specific to either mawk-1 or gawk; limitations being :
- middle field and right most field has hard
cap of
8^5-1
- left most field allows up to
8^6-1
The approach is to create a unified sorting key that sorts the same both numerically and in ASCII byte order, while allowing sufficient growth room for each of the 3 fields.
Pure duplicates are printed out on a LIFO basis
The 2 prefix ascii control bytes are used to prevent anywhere along the process flow, both within and beyond awk, attempting a purely numeric at insufficient floating point precision when it sees the hex that's potentially 80-bit in size.
WHINY_USERS=1 {m,g}awk ' # this is a shell param for mawk-1
BEGIN {
PROCINFO["sorted_in"] = "@ind_str_asc"
FS = "["(_=+(\
OFS = "." ) )"]"
} { __[\
____($_)]=$_ } END { for(_ in __) {
print __[_] } }
function ____(___,__,_) {
return \
sprintf("\31\17%.*s%.8X%.4X%.8X",(__="")*split(__,_),
split(___,_,"[.]"), int((__=_[++__]*(___=(++__^++__\
)^(__--+__))*___ + _[__]*___ + _[++__]) \
)/(___+=___),__%___,___*___-___^(!___)-NR)
}'
|
2020.5.18
2020.10.1
2020.10.4
2021.1.1
2023.12.14
2023.14.1