For what it's worth, even if you have a multi-dimensional array a simple change to
colucix's suggestion could be used:
Code:
for (index in array) {
readable_index=gensub(SUBSEP,", ","G",index)
print "array["readable_index"] = " array[index]
}
You might want to look at the
asort and
asorti functions if the order of the array elements is of significance.
Note: Some of the above is specific to
gawk, and may not be portable.