Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 12 13 14 15 16 17 18
- 2 21 22 23 24 25 26 27 28 29
- ... --------
- 1 15
- 2 25
- ....
- perl -MList::Util=sum -ane 'printf "%s %sn", shift @F, sum(@F)/(@F?@F:1)' file
- 1 15
- 2 25
- awk '{ s = 0; for (i = 2; i <= NF; i++) s += $i; print $1, (NF > 1) ? s / (NF - 1) : 0; }' file
- 1 15
- 2 25
Add Comment
Please, Sign In to add comment