Need Optimization shell/awk script to aggreagte (sum) for all the columns of Huge data file

Optimization shell/awk script to aggregate (sum) for all the columns of Huge data file

File delimiter "|"
Need to have Sum of all columns, with column number : aggregation (summation) for each column
File not having the header

Like below -
Column 1 "Total
Column 2 : "Total
...
...
Column N : "Total :

Please post a sample representative chunk of a file.

something along these lines:

awk -F'|' '{for(i=1;i<=NF;i++) a+=$i} END{for(i=1; i in a;i++) printf("Column %d: %d\n", i, a)}' myFile
2 Likes