Does anyone know how to find length of multi dimension array
of following type
A[FILE,INDEX,COLUMN]
A[INDEX, COLUMN]
for simple array I is to do
for (i in A)n++
to find length of array but if it is multi dimension how to find the length ?
What language is this?
It looks like awk, but awk doesn't have "multidimensional arrays" as such... Just a big list of indexes and elements. When you give more than one index, it actually crams them into a string like INDEX1 SUBSEP INDEX2 SUBSEP INDEX3.
So your method would still count every individual element of a multidimensional awk array. But they would have to all be filled. Any unset elements would not be counted.
Thanks Corona for reply
I tried like this to remove blank fields
Worked fine
for(i=1;i<=10;i++)
if(A[1,i,1]=="")
print "Blank"
else
{
f++
for(m=1;m<=5;m++)
F[f,m]=A[1,i,1]
}