# example - gawk -f avgcolumn.awk I=8 attr.out BEGIN { FS=OFS="," Sum=0; I=1; } { Sum += $I } END { print Sum/NR }