Re: Breaking a table of record rows into an array

Liste des GroupesRevenir à cl awk 
Sujet : Re: Breaking a table of record rows into an array
De : arnold (at) *nospam* freefriends.org (Aharon Robbins)
Groupes : comp.lang.awk
Date : 14. Mar 2024, 07:19:40
Autres entêtes
Organisation : non
Message-ID : <65f296fc$0$713$14726298@news.sunsite.dk>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <87y1am5cfo.fsf@nosuchdomain.example.com>,
Keith Thompson  <Keith.S.Thompson+u@gmail.com> wrote:
Do you see something in POSIX that defines the behavior of assigning to
NF?

In the section "Variables and Special Values"

| References to nonexistent fields (that is, fields after $NF), shall
| evaluate to the uninitialized value. Such references shall not create
| new fields. However, assigning to a nonexistent field (for example,
| $(NF+2)=5) shall increase the value of NF; create any intervening fields
| with the uninitialized value; and cause the value of $0 to be
| recomputed, with the fields being separated by the value of OFS. Each
| field variable shall have a string value or an uninitialized value when
| created.

It doesn't say what happens when you do NF -= 2; nonetheless, all
traditional awks throw away fields when you do something like that.

Date Sujet#  Auteur
11 Mar 24 * Re: Breaking a table of record rows into an array19Mr. Man-wai Chang
11 Mar 24 +- Re: Breaking a table of record rows into an array1Keith Thompson
12 Mar 24 +- Re: Breaking a table of record rows into an array1Janis Papanagnou
13 Mar 24 `* Re: Breaking a table of record rows into an array16Ed Morton
13 Mar 24  `* Re: Breaking a table of record rows into an array15Aharon Robbins
13 Mar 24   +* Re: Breaking a table of record rows into an array13Keith Thompson
13 Mar 24   i+* Re: Breaking a table of record rows into an array7Kaz Kylheku
13 Mar 24   ii`* Re: Breaking a table of record rows into an array6Keith Thompson
13 Mar 24   ii +* Re: Breaking a table of record rows into an array4Kaz Kylheku
14 Mar 24   ii i+* Re: Breaking a table of record rows into an array2Ed Morton
14 Mar 24   ii ii`- Re: Breaking a table of record rows into an array1Kaz Kylheku
14 Mar 24   ii i`- Re: Breaking a table of record rows into an array1Keith Thompson
14 Mar 24   ii `- Re: Breaking a table of record rows into an array1Kaz Kylheku
14 Mar 24   i`* Re: Breaking a table of record rows into an array5Aharon Robbins
14 Mar 24   i +- Re: Breaking a table of record rows into an array1Keith Thompson
14 Mar 24   i `* Re: Breaking a table of record rows into an array3Ed Morton
14 Mar 24   i  `* Re: Breaking a table of record rows into an array2Ed Morton
14 Mar 24   i   `- Re: Breaking a table of record rows into an array1Ed Morton
14 Mar 24   `- Re: Breaking a table of record rows into an array1Ed Morton

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal