Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The less time planning, the more time programming.


devel / comp.lang.awk / Sorting indices numerically

SubjectAuthor
* Sorting indices numericallysolitary....@gmail.com
`* Re: Sorting indices numericallyEd Morton
 `- Re: Sorting indices numericallysolitary....@gmail.com

1
Sorting indices numerically

<650a5c34-3ad8-4ce1-a868-8987b7d2dc05n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=959&group=comp.lang.awk#959

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:d09:: with SMTP id 9mr14400399qkn.409.1635179197803;
Mon, 25 Oct 2021 09:26:37 -0700 (PDT)
X-Received: by 2002:a25:7c81:: with SMTP id x123mr17343243ybc.185.1635179197413;
Mon, 25 Oct 2021 09:26:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 25 Oct 2021 09:26:37 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=70.185.240.18; posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 70.185.240.18
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <650a5c34-3ad8-4ce1-a868-8987b7d2dc05n@googlegroups.com>
Subject: Sorting indices numerically
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Mon, 25 Oct 2021 16:26:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 3
 by: solitary....@gmail.c - Mon, 25 Oct 2021 16:26 UTC

I have a multi-dimensional array where 1 of the levels has integers and I would like to sort this level numerically. I thought one could do this placing a certain value in the 3rd subscript of asorti. Is that true? If so, what is the value?

Thanks, Steve

Re: Sorting indices numerically

<sl6mmv$84a$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=960&group=comp.lang.awk#960

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: mortonspam@gmail.com (Ed Morton)
Newsgroups: comp.lang.awk
Subject: Re: Sorting indices numerically
Date: Mon, 25 Oct 2021 11:41:04 -0500
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <sl6mmv$84a$1@dont-email.me>
References: <650a5c34-3ad8-4ce1-a868-8987b7d2dc05n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Oct 2021 16:41:03 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8d012b2bb624e82b8f737ec9f479e586";
logging-data="8330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Td2PrDIam7+NeFSRU+tXb"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.1
Cancel-Lock: sha1:cdg5ygq+iyLz1CAEBEod/LFotj4=
In-Reply-To: <650a5c34-3ad8-4ce1-a868-8987b7d2dc05n@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-US
X-Antivirus: Avast (VPS 211025-4, 10/25/2021), Outbound message
 by: Ed Morton - Mon, 25 Oct 2021 16:41 UTC

On 10/25/2021 11:26 AM, solitary....@gmail.com wrote:
> I have a multi-dimensional array where 1 of the levels has integers and I would like to sort this level numerically. I thought one could do this placing a certain value in the 3rd subscript of asorti. Is that true? If so, what is the value?
>
>
> Thanks, Steve
>

Yes, see
https://www.gnu.org/software/gawk/manual/gawk.html#Controlling-Scanning.
See also
https://www.gnu.org/software/gawk/manual/gawk.html#Array-Sorting as you
may not need asorti() depending on what you're going to do with the result.

Note that asorti() is a GNU awk extension.

Ed.

Re: Sorting indices numerically

<061aac97-91a4-43d4-b11a-3659ebc5c151n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=961&group=comp.lang.awk#961

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:7c46:: with SMTP id o6mr20168462qtv.197.1635195809169;
Mon, 25 Oct 2021 14:03:29 -0700 (PDT)
X-Received: by 2002:a25:3845:: with SMTP id f66mr21702064yba.469.1635195808835;
Mon, 25 Oct 2021 14:03:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 25 Oct 2021 14:03:28 -0700 (PDT)
In-Reply-To: <sl6mmv$84a$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=70.185.240.18; posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 70.185.240.18
References: <650a5c34-3ad8-4ce1-a868-8987b7d2dc05n@googlegroups.com> <sl6mmv$84a$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <061aac97-91a4-43d4-b11a-3659ebc5c151n@googlegroups.com>
Subject: Re: Sorting indices numerically
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Mon, 25 Oct 2021 21:03:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: solitary....@gmail.c - Mon, 25 Oct 2021 21:03 UTC

On Monday, October 25, 2021 at 11:41:05 AM UTC-5, Ed Morton wrote:
> On 10/25/2021 11:26 AM, solitary....@gmail.com wrote:
> > I have a multi-dimensional array where 1 of the levels has integers and I would like to sort this level numerically. I thought one could do this placing a certain value in the 3rd subscript of asorti. Is that true? If so, what is the value?
> >
> >
> > Thanks, Steve
> >
> Yes, see
> https://www.gnu.org/software/gawk/manual/gawk.html#Controlling-Scanning.
> See also
> https://www.gnu.org/software/gawk/manual/gawk.html#Array-Sorting as you
> may not need asorti() depending on what you're going to do with the result.
>
> Note that asorti() is a GNU awk extension.
>
> Ed.

Thanks, Ed. Worked like a charm.

Steve

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor