For data analysis, there is sometimes a need for calculating average over columns (from a text file, e.g., motion parameter file in fMRI data analysis). Awk presents a quick solution for such needs:
Code for averaging over the first column of a file (hence $1 below):
cat <filename> | awk '{total += $1; count++} END {print total/count}'