[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Is there an easy-to-use function to print multiple dimens
From: |
Lorenz |
Subject: |
Re: [bug-gawk] Is there an easy-to-use function to print multiple dimensional array? |
Date: |
Mon, 29 May 2017 13:49:04 +0000 |
Peng Yu wrote:
>Hi, I'd like to make the debug of awk code easy. Is there a
>easy-to-use function that can print multiple dimensional array?
function prnArray(array, level) {
if (isarray(array)) {
for (i in array) {
prnArray(i, level)
prnArray(array[i], level+1)
}
}
else {
printf("%*s%s\n", 2*level, "", array)
}
}
set PROCINFO["sorted_in"] as required
--
Lorenz