awk in horizontal and vertical math

Based on input

ail,UTT,id1_0,COMBO,21,24,21,19,85
al,UTHAST,id1_0,COMBO,342,390,361,361,1454

and awk code as

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.

Regards,

Could you please post the expected output for the given input.

addition of NF till NF-4 both in lines and in columns.

awk -F, '{ sum=0; for (i=5;i<=NF;i++) sum+=$i; print $0","sum}' filename

This will always work from the 5th column oly....

@RudiC,
I was working on that particular thread earlier and thought to do it via awk arrays. That's what I didn't want..

Regards,

So - what be your problem / question? Reading your post #1 I'm not sure what it is about...