awk -F, '{ K=0; for(i=NF; i>=(NF-4); i--) { K=K+$i; J=J+$i;} { print K } } END { for ( l in J ) printf("%s ",J[l]); }'
I'm trying to add columns and lines in single line. line sums are displayed at the end of current line and the column sums at the end of all line.
Please note this is from an older thread in this forum, where I just got stuck.