Yepp, it all depends on how you initially store the data to the hash table.
/hsave -i could ease the job, one might remove the created "ini topic" [hashtable] then and perform a /filter to remove all non-matches for a specific search term, together with (or prior to) sorting the data via /filter.
Simple example for the hsave/remove topic/sort (without the "filter for matches" part):
alias sorttest {
; add some items
hadd -m testtable nick1 address4=ip2=mail3
hadd testtable nick3 address3=ip3=mail2
hadd testtable nick2 address2=ip1=mail4
hadd testtable nick4 address1=ip4=mail1
if ($isfile(test.txt)) { .remove test.txt }
; save table in ini format
hsave -i testtable test.txt
; remove ini topic
write -dl1 test.txt
; sort by a collumn
filter -ffct $1 61 test.txt test.txt
; add a "header" line
write -il1 test.txt Data Sorted by collumn $1 :
run test.txt
hfree testtable
}
/sorttest <N of collumn>