Take the tour ×  Given a tab separated data file (or another
separator), how would you compute the mean of a column?  Too bad
that there are no simple binaries that performs simple
mathematical operations over those kind of files.  share|improve
this question add comment  2 Answers  up vote 7 down vote
accepted awk -F'\t' '{ sum += $1 } END { print sum / NR }'  Here
$1 is the first \tab-separated column.  share|improve this
answer add comment  If you have R installed you can also use:
Rscript -e "(mean(read.table(\"file.tab\")))"  You can also
change the function (mean) to other statistical functions, say:
Rscript -e "(sd(read.table(\"file.tab\")))" Rscript -e
"(summary(read.table(\"file.tab\")))"  If you want to specify
the column, say, use column 3, then you use the notation [,3]
Rscript -e "(sum(read.table(\"file\")[,3]))"   share|improve
this answer add comment  Your Answer