Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Real programmers don't comment their code. It was hard to write, it should be hard to understand.


devel / comp.lang.awk / Re: Difficulty in parsing 2-dimensional array

SubjectAuthor
* Difficulty in parsing 2-dimensional arraysolitary....@gmail.com
+* Re: Difficulty in parsing 2-dimensional arrayEd Morton
|`- Re: Difficulty in parsing 2-dimensional arraysolitary....@gmail.com
`* Re: Difficulty in parsing 2-dimensional arrayJanis Papanagnou
 `* Re: Difficulty in parsing 2-dimensional arraysolitary....@gmail.com
  `* Re: Difficulty in parsing 2-dimensional arrayJanis Papanagnou
   `- Re: Difficulty in parsing 2-dimensional arraysolitary....@gmail.com

1
Difficulty in parsing 2-dimensional array

<6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:e102:0:b0:69f:8463:cbdd with SMTP id c2-20020a37e102000000b0069f8463cbddmr16666105qkm.766.1651691464630;
Wed, 04 May 2022 12:11:04 -0700 (PDT)
X-Received: by 2002:a81:ff12:0:b0:2db:2d8a:9769 with SMTP id
k18-20020a81ff12000000b002db2d8a9769mr20930999ywn.172.1651691464442; Wed, 04
May 2022 12:11:04 -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: Wed, 4 May 2022 12:11:04 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:4d19:6100:f5ea:13bd:8070:9e67;
posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 2600:8804:4d19:6100:f5ea:13bd:8070:9e67
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
Subject: Difficulty in parsing 2-dimensional array
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Wed, 04 May 2022 19:11:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 79
 by: solitary....@gmail.c - Wed, 4 May 2022 19:11 UTC

I'm trying to parse a 2-dimensional array and I'm getting the message "fatal: asorti: first argument not an array;" on the line "n2 = asorti(ss[sub1],sortedSS2);".

ss is the original 2-dimensional array. Not sure why it thinks that ss[sub1] is not an array.

Appreciate in advance the effort to show me what I'm missing.

Steve

==
The script followings:

# Create task list
#
function getValue(num,title) {
getline;
if (length($0)) {
ss[num, title] = $0;
# print "ss[" num "," title "]= " $0
}

return
} BEGIN {
PROCINFO["sorted_in"]="@ind_str_asc";
titleList = "Number;Submitted by;Created by;Location;Affected End-user;Affected User Building Number;Affected User Room Number;Telework;Best Contact Method;Affected User Best Fol low-up Phone Number;Category;Subcategory;Created by;Portfolio;Product Line;Affected Service;Affected CI;Contact type;State;On hold reason;Impact;Urgency;Priority;Follow up;Assignment gro up;Assigned to;Queue Manager;Backup Queue Manager;Affects Patient Safety;Patient Safety Tracker #;Patient Safety Notes;Describe any actual/potential patient harm;Initiative;Short Descrip tion;Description;Affected System Name / EE Number / Hostname;Non-VA Partner";
n = split(titleList,arr,";");
for (i = 1; i <= n; i++) {
title = arr[i];
titleArr[title] = i;
titleXArr[i] = title;
}
}

{
if ($0 == "===") {
next
}
if ($0 == "Number") {
getline;
num = $0;
next;
}
if (titleArr[$0]) {
title = $0;
getValue(num, title);
next
}
if (length(ss[num, title])) {
ss[num, title] = ss[num, title] " " $0
# print "ss[" num "," title "]= " $0
}
} END {
n1 = asorti(ss, sortedSS);
print "n1 = " n1;
for (i = 1; i <= n1; i++) {
sub1 = sortedSS[i];
n2 = asorti(ss[sub1],sortedSS2);
print " n2 = " n2;
for (j = 1; j <= n2; j++) {
sub2 = sortedSS2[j];
print "a,b = ? " sub1 "," sub2 " = " ss[sub1, sub2];
}
}
}

Re: Difficulty in parsing 2-dimensional array

<t4ukhd$o97$1@dont-email.me>

  copy mid

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

  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: Difficulty in parsing 2-dimensional array
Date: Wed, 4 May 2022 14:35:09 -0500
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <t4ukhd$o97$1@dont-email.me>
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 4 May 2022 19:35:09 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1c8a3202bcf9adbe0fc34802ecee517c";
logging-data="24871"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+faStLsT9ZSIcVeCUY2kzp"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
Cancel-Lock: sha1:cImE1X33l5KEWH3ZgydM+/4bn4Y=
In-Reply-To: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-US
X-Antivirus: Avast (VPS 220503-14, 5/3/2022), Outbound message
 by: Ed Morton - Wed, 4 May 2022 19:35 UTC

On 5/4/2022 2:11 PM, solitary....@gmail.com wrote:
> I'm trying to parse a 2-dimensional array and I'm getting the message "fatal: asorti: first argument not an array;" on the line "n2 = asorti(ss[sub1],sortedSS2);".
>
> ss is the original 2-dimensional array. Not sure why it thinks that ss[sub1] is not an array.
>
> Appreciate in advance the effort to show me what I'm missing.

Please reduce your code to a minimal example that demonstrates the
problem and provide concise, testable sample input and expected output
so it's easiest for us to help you.

Ed.

Re: Difficulty in parsing 2-dimensional array

<t4ukqc$ro8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: Difficulty in parsing 2-dimensional array
Date: Wed, 4 May 2022 21:39:56 +0200
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <t4ukqc$ro8$1@dont-email.me>
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 4 May 2022 19:39:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="afc76203325e4188a327a7d338a456c7";
logging-data="28424"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lS4E9QsZghVQpadmkaJtK"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:DF9K1SI5NsnalEYIMQAVBj2j9pQ=
In-Reply-To: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Wed, 4 May 2022 19:39 UTC

On 04.05.2022 21:11, solitary....@gmail.com wrote:
> I'm trying to parse a 2-dimensional array and I'm getting the message "fatal: asorti: first argument not an array;" on the line "n2 = asorti(ss[sub1],sortedSS2);".
>
> ss is the original 2-dimensional array. Not sure why it thinks that ss[sub1] is not an array.
>
> Appreciate in advance the effort to show me what I'm missing.

You seem to intend using true multidimensional arrays (a[x][y]), but
in your code I see awk's old style array emulations (a[x,y]), like

ss[num, title] " " $0

The indices 'num' and 'title' compose to a single associative key
concatenated as

num SUBSEP title

In this case using ss[anything] is not an array but a scalar, and
thus

n2 = asorti(ss[sub1],sortedSS2);

reports an error, because ss[sub1] is also a scalar.

Read the GNU Awk manual ("Arrays of Arrays") for all the details.

Janis

>
>
> Steve
>
> ===
>
> The script followings:
>
> # Create task list
> #
> function getValue(num,title) {
> getline;
> if (length($0)) {
> ss[num, title] = $0;
> # print "ss[" num "," title "]= " $0
> }
>
> return
> }
> BEGIN {
> PROCINFO["sorted_in"]="@ind_str_asc";
> titleList = "Number;Submitted by;Created by;Location;Affected End-user;Affected User Building Number;Affected User Room Number;Telework;Best Contact Method;Affected User Best Fol low-up Phone Number;Category;Subcategory;Created by;Portfolio;Product Line;Affected Service;Affected CI;Contact type;State;On hold reason;Impact;Urgency;Priority;Follow up;Assignment gro up;Assigned to;Queue Manager;Backup Queue Manager;Affects Patient Safety;Patient Safety Tracker #;Patient Safety Notes;Describe any actual/potential patient harm;Initiative;Short Descrip tion;Description;Affected System Name / EE Number / Hostname;Non-VA Partner";
> n = split(titleList,arr,";");
> for (i = 1; i <= n; i++) {
> title = arr[i];
> titleArr[title] = i;
> titleXArr[i] = title;
> }
> }
>
> {
> if ($0 == "===") {
> next
> }
> if ($0 == "Number") {
> getline;
> num = $0;
> next;
> }
> if (titleArr[$0]) {
> title = $0;
> getValue(num, title);
> next
> }
> if (length(ss[num, title])) {
> ss[num, title] = ss[num, title] " " $0
> # print "ss[" num "," title "]= " $0
> }
> }
> END {
> n1 = asorti(ss, sortedSS);
> print "n1 = " n1;
> for (i = 1; i <= n1; i++) {
> sub1 = sortedSS[i];
> n2 = asorti(ss[sub1],sortedSS2);
> print " n2 = " n2;
> for (j = 1; j <= n2; j++) {
> sub2 = sortedSS2[j];
> print "a,b = ? " sub1 "," sub2 " = " ss[sub1, sub2];
> }
> }
> }
>

Re: Difficulty in parsing 2-dimensional array

<c9bc2ea4-3ed0-4ec9-aac8-ece85b74bae2n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:472a:b0:6a0:23f0:6a64 with SMTP id bs42-20020a05620a472a00b006a023f06a64mr2078334qkb.534.1651696123797;
Wed, 04 May 2022 13:28:43 -0700 (PDT)
X-Received: by 2002:a0d:fc45:0:b0:2eb:65c0:26f with SMTP id
m66-20020a0dfc45000000b002eb65c0026fmr21764604ywf.22.1651696123512; Wed, 04
May 2022 13:28:43 -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: Wed, 4 May 2022 13:28:43 -0700 (PDT)
In-Reply-To: <t4ukhd$o97$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:4d19:6100:f5ea:13bd:8070:9e67;
posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 2600:8804:4d19:6100:f5ea:13bd:8070:9e67
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com> <t4ukhd$o97$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9bc2ea4-3ed0-4ec9-aac8-ece85b74bae2n@googlegroups.com>
Subject: Re: Difficulty in parsing 2-dimensional array
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Wed, 04 May 2022 20:28:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: solitary....@gmail.c - Wed, 4 May 2022 20:28 UTC

On Wednesday, May 4, 2022 at 2:35:11 PM UTC-5, Ed Morton wrote:
> On 5/4/2022 2:11 PM, solitary....@gmail.com wrote:
> > I'm trying to parse a 2-dimensional array and I'm getting the message "fatal: asorti: first argument not an array;" on the line "n2 = asorti(ss[sub1],sortedSS2);".
> >
> > ss is the original 2-dimensional array. Not sure why it thinks that ss[sub1] is not an array.
> >
> > Appreciate in advance the effort to show me what I'm missing.
> Please reduce your code to a minimal example that demonstrates the
> problem and provide concise, testable sample input and expected output
> so it's easiest for us to help you.
>
> Ed.

A smaller example would have been preferable. Agreed.

Steve

Re: Difficulty in parsing 2-dimensional array

<e65db50f-62e7-4391-896e-056eb1b12764n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:622a:134d:b0:2f3:ac46:28c with SMTP id w13-20020a05622a134d00b002f3ac46028cmr11686472qtk.342.1651696278832;
Wed, 04 May 2022 13:31:18 -0700 (PDT)
X-Received: by 2002:a25:2e4e:0:b0:648:6652:ca6e with SMTP id
b14-20020a252e4e000000b006486652ca6emr18680899ybn.345.1651696278544; Wed, 04
May 2022 13:31:18 -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: Wed, 4 May 2022 13:31:18 -0700 (PDT)
In-Reply-To: <t4ukqc$ro8$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:4d19:6100:f5ea:13bd:8070:9e67;
posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 2600:8804:4d19:6100:f5ea:13bd:8070:9e67
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com> <t4ukqc$ro8$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e65db50f-62e7-4391-896e-056eb1b12764n@googlegroups.com>
Subject: Re: Difficulty in parsing 2-dimensional array
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Wed, 04 May 2022 20:31:18 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 108
 by: solitary....@gmail.c - Wed, 4 May 2022 20:31 UTC

On Wednesday, May 4, 2022 at 2:39:59 PM UTC-5, Janis Papanagnou wrote:
Thanks for the lesson. Didn't realize that sub1, sub2 resulted in a single subscript.

I changed all to [sub1][sub2] and got the same error. But it printed only a small portion of what it printed before.

Odd.

Steve

> On 04.05.2022 21:11, solitary....@gmail.com wrote:
> > I'm trying to parse a 2-dimensional array and I'm getting the message "fatal: asorti: first argument not an array;" on the line "n2 = asorti(ss[sub1],sortedSS2);".
> >
> > ss is the original 2-dimensional array. Not sure why it thinks that ss[sub1] is not an array.
> >
> > Appreciate in advance the effort to show me what I'm missing.
> You seem to intend using true multidimensional arrays (a[x][y]), but
> in your code I see awk's old style array emulations (a[x,y]), like
>
> ss[num, title] " " $0
>
> The indices 'num' and 'title' compose to a single associative key
> concatenated as
>
> num SUBSEP title
>
> In this case using ss[anything] is not an array but a scalar, and
> thus
> n2 = asorti(ss[sub1],sortedSS2);
> reports an error, because ss[sub1] is also a scalar.
>
> Read the GNU Awk manual ("Arrays of Arrays") for all the details.
>
> Janis
> >
> >
> > Steve
> >
> > ===
> >
> > The script followings:
> >
> > # Create task list
> > #
> > function getValue(num,title) {
> > getline;
> > if (length($0)) {
> > ss[num, title] = $0;
> > # print "ss[" num "," title "]= " $0
> > }
> >
> > return
> > }
> > BEGIN {
> > PROCINFO["sorted_in"]="@ind_str_asc";
> > titleList = "Number;Submitted by;Created by;Location;Affected End-user;Affected User Building Number;Affected User Room Number;Telework;Best Contact Method;Affected User Best Fol low-up Phone Number;Category;Subcategory;Created by;Portfolio;Product Line;Affected Service;Affected CI;Contact type;State;On hold reason;Impact;Urgency;Priority;Follow up;Assignment gro up;Assigned to;Queue Manager;Backup Queue Manager;Affects Patient Safety;Patient Safety Tracker #;Patient Safety Notes;Describe any actual/potential patient harm;Initiative;Short Descrip tion;Description;Affected System Name / EE Number / Hostname;Non-VA Partner";
> > n = split(titleList,arr,";");
> > for (i = 1; i <= n; i++) {
> > title = arr[i];
> > titleArr[title] = i;
> > titleXArr[i] = title;
> > }
> > }
> >
> > {
> > if ($0 == "===") {
> > next
> > }
> > if ($0 == "Number") {
> > getline;
> > num = $0;
> > next;
> > }
> > if (titleArr[$0]) {
> > title = $0;
> > getValue(num, title);
> > next
> > }
> > if (length(ss[num, title])) {
> > ss[num, title] = ss[num, title] " " $0
> > # print "ss[" num "," title "]= " $0
> > }
> > }
> > END {
> > n1 = asorti(ss, sortedSS);
> > print "n1 = " n1;
> > for (i = 1; i <= n1; i++) {
> > sub1 = sortedSS[i];
> > n2 = asorti(ss[sub1],sortedSS2);
> > print " n2 = " n2;
> > for (j = 1; j <= n2; j++) {
> > sub2 = sortedSS2[j];
> > print "a,b = ? " sub1 "," sub2 " = " ss[sub1, sub2];
> > }
> > }
> > }
> >

Re: Difficulty in parsing 2-dimensional array

<t4uv68$c34$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: Difficulty in parsing 2-dimensional array
Date: Thu, 5 May 2022 00:36:55 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <t4uv68$c34$1@dont-email.me>
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
<t4ukqc$ro8$1@dont-email.me>
<e65db50f-62e7-4391-896e-056eb1b12764n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 4 May 2022 22:36:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="384a4ce89a706add02493a0a4617ef90";
logging-data="12388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aw81zr48eqe6SpY5RWiU9"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:YfkaU0LA3hMnsZR9THCxX5zsmFo=
In-Reply-To: <e65db50f-62e7-4391-896e-056eb1b12764n@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Wed, 4 May 2022 22:36 UTC

On 04.05.2022 22:31, solitary....@gmail.com wrote:
> On Wednesday, May 4, 2022 at 2:39:59 PM UTC-5, Janis Papanagnou wrote:
> Thanks for the lesson. Didn't realize that sub1, sub2 resulted in a single subscript.
>
> I changed all to [sub1][sub2] and got the same error.

I'm not sure that would suffice; we'd need to see the whole code
to judge. (Ideally in a reduced version.) You can also print the
_type information_ of the array indices and components at every
occurrence to track or easier find out where a wrong index type
has been used in your code.

> But it printed only a small portion of what it printed before.

You may (as suggested by Ed) try to reduce the sample. Or use the
GNU Awk debugger to track the issue.

Janis

>
> Odd.
>
> Steve
>
[...]

Re: Difficulty in parsing 2-dimensional array

<a444c4ff-cf8a-49ca-8277-1cf4847ef11an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:7c8:0:b0:69f:c5f8:85a2 with SMTP id 191-20020a3707c8000000b0069fc5f885a2mr16617901qkh.662.1651704489801;
Wed, 04 May 2022 15:48:09 -0700 (PDT)
X-Received: by 2002:a5b:68a:0:b0:648:fcd2:3767 with SMTP id
j10-20020a5b068a000000b00648fcd23767mr20104091ybq.358.1651704489640; Wed, 04
May 2022 15:48:09 -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: Wed, 4 May 2022 15:48:09 -0700 (PDT)
In-Reply-To: <t4uv68$c34$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:4d19:6100:f5ea:13bd:8070:9e67;
posting-account=lMndggoAAACR6bdLBlBjeKrA4qihooHu
NNTP-Posting-Host: 2600:8804:4d19:6100:f5ea:13bd:8070:9e67
References: <6fb95378-02c6-431d-8240-edf1f5c4e76bn@googlegroups.com>
<t4ukqc$ro8$1@dont-email.me> <e65db50f-62e7-4391-896e-056eb1b12764n@googlegroups.com>
<t4uv68$c34$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a444c4ff-cf8a-49ca-8277-1cf4847ef11an@googlegroups.com>
Subject: Re: Difficulty in parsing 2-dimensional array
From: solitary.wanderer52@gmail.com (solitary....@gmail.com)
Injection-Date: Wed, 04 May 2022 22:48:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 36
 by: solitary....@gmail.c - Wed, 4 May 2022 22:48 UTC

The first level subscript is work order and the second level is category. The first batch worked as expected. Then the next work order looked like the previous work order plus some control characters and maybe something more. I pattern matching to only work with work order numbers that were "proper". That fixed the problem.

Thanks so much. Fixed a script and learned more Awk. Great!!!

Steve

---

On Wednesday, May 4, 2022 at 5:36:58 PM UTC-5, Janis Papanagnou wrote:
> On 04.05.2022 22:31, solitary....@gmail.com wrote:
> > On Wednesday, May 4, 2022 at 2:39:59 PM UTC-5, Janis Papanagnou wrote:
> > Thanks for the lesson. Didn't realize that sub1, sub2 resulted in a single subscript.
> >
> > I changed all to [sub1][sub2] and got the same error.
> I'm not sure that would suffice; we'd need to see the whole code
> to judge. (Ideally in a reduced version.) You can also print the
> _type information_ of the array indices and components at every
> occurrence to track or easier find out where a wrong index type
> has been used in your code.
> > But it printed only a small portion of what it printed before.
> You may (as suggested by Ed) try to reduce the sample. Or use the
> GNU Awk debugger to track the issue.
>
> Janis
>
> >
> > Odd.
> >
> > Steve
> >
> [...]

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor