I am putting together a (g)awk file script that loops through the numeric data provided from in an input file, and has to sum the values in each row. I am creating an array and adding the row sums to each array position. Below is my code. The logic seems ok, but the output is off:
for(i = 1; i <= NF; ++i){
for(j = 1; j <= NR; ++j){
row[i] += $j
}
}