In a single dim. awk array, we can use :
<index> in <array name>
to determine whether a particualar index exists in the array or not.
Is there a way to achieve this in a awk multi dim. array ?
In a single dim. awk array, we can use :
<index> in <array name>
to determine whether a particualar index exists in the array or not.
Is there a way to achieve this in a awk multi dim. array ?
I am not sure if multi dimensioning is supported in awk.
Anyhow we can achieve same result by combining (may be with a delimit) multiple fields.
Am sorry , I didnt get that.
Do you mean if the multi dim array is a [3,2] array then we need to :-
3 in <array name> AND 2 in <array name>
?
echo 20 | awk '{ ndx="1,1"; a[ndx]=$1; } END { for (ndx in a) { printf("%s-->%s\n",ndx,a[ndx]); } }'
may be something like this
GR8. this works. thnx very much.