How can I calculate the SUM for all the individual columns (115 Columns)?
Input.txt
1st,2nd,3rd,4th,5th,Till-115thColumn
51,34,27,67,88,99
56,39,32,72,93,104
66,49,42,82,103,114
Output.txt
1st,2nd,3rd,4th,5th,Till-115thColumn
173,122,101,221,284,317
I tried this command:
awk -F"," 'BEGIN {sum=0; OFS=","} {for (i=1 i<=NF; i++) a[i]+=$i } END {for (i in a) print a[i]}' Input.txt
but I am not getting the required output.