Sorting with GNU Awk

Liste des GroupesRevenir à cl awk 
Sujet : Sorting with GNU Awk
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.awk
Date : 11. Feb 2025, 03:13:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <voebnd$1fnqi$1@dont-email.me>
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
I have an application were I need sorting. My tests led me to
this variant that works as I expected (with GNU Awk 5.3.0)

  asort (arr, res, "@val_num_desc")

But I originally intended an _inplace_ sort and I thought that
using these commands would also work

  PROCINFO["sorted_in"] = "@val_num_desc"
  asort (arr)

but the sorting order is (contrary to my specifier) ascending.
So it seems PROCINFO is not considered by the asort() function?
(Or is that just inappropriately used?)

Another question; is there a simple way for a _unique sorting_
like Unix'es 'sort -u'? - By simple I mean some setting, not a
programmed function like using associative array indexes, etc.

Janis

Date Sujet#  Auteur
11 Feb 25 * Sorting with GNU Awk3Janis Papanagnou
11 Feb 25 `* Re: Sorting with GNU Awk2Kaz Kylheku
11 Feb 25  `- Re: Sorting with GNU Awk1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal