I looked through it and found that after AWK 4.0 we can print the array in a specific order by placing the PROCINFO ["sorted_in"] command right before the loop. for instance
PROCINFO["sorted_in"] = "@ind_num_asc"
for( i in array)
print i, array[i]
In AWK 4.0.2, it works. However, I tried this in AWK 3.1.3, this did not work. Doesn't this early version of AWK support this feature? How to achieve this goal in AWK 3.1.3?
source
share