Nice bash (command line) file manipulation tricks:
Average the numbers: http://superuser.com/questions/165827/csv-averages-on-linux-command-line
Skip some lines of a file: http://unix.stackexchange.com/questions/37790/how-do-i-delete-the-first-n-lines-of-an-ascii-file-using-shell-commands
Average the numbers: http://superuser.com/questions/165827/csv-averages-on-linux-command-line
Skip some lines of a file: http://unix.stackexchange.com/questions/37790/how-do-i-delete-the-first-n-lines-of-an-ascii-file-using-shell-commands