From mboxrd@z Thu Jan 1 00:00:00 1970 From: dexen deVries To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Thu, 20 Dec 2012 09:41:51 +0100 Message-ID: <1524022.R5NRI7ML3A@coil> User-Agent: KMail/4.9.4 (Linux/3.7.0-l47; KDE/4.9.4; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [9fans] awk, connect a string to a variable or a function Topicbox-Message-UUID: f8e2382a-ead7-11e9-9d60-3106f5b1d025 On Thursday 20 of December 2012 08:44:36 Rudolf Sykora wrote: > Hello, >=20 > awk doesn't have arrays with array members, which is what I now need.= how about using two-level array? BEGIN { =09a["foo",1] =3D "abc" =09a["foo",2] =3D "pqr" =09a["foo",3] =3D "xyz" =09a["bar",1] =3D "B1" =09a["bar", 2] =3D "B2" =09a["bar", 3] =3D "B3" =09for (i in a) =09=09if (i ~ "foo") =09=09=09print a[i] } hope that helps, --=20 dexen deVries [[[=E2=86=93][=E2=86=92]]] Reality is just a convenient measure of complexity. -- Alvy Ray Smith