cristalp |
12-06-2011 01:59 PM |
AWK; print array in loop no output
Dear all,
I have tried code:
Code:
awk 'BEGIN {uk[1]=3333;uk[2]=5555;uk[3]=6666;a[1]=0;a[2]=1;a[3]=2;for(i=1;i<=3;i++) mith[i] = sprintf("%2.1f %s", a[i], uk[i]);print mith[i]}'
But I do not have any output from this code. I tried that if I do not use loop, I can get output. So, what's wrong with the loop and how could I revise it to see the output? (I still need to use the loop to simplify my problem. The array in my real problem contains too many elements)
Thanks!!!
|