Using awk:
awk -F',' 'BEGIN{a=0}'{p[a] p[NR] = $1;net[a]$1;net[NR] = $2+$3-$4; ++a$4} END {for (i=1;i<NR;i++i=2;i<=NR;i++) print (i-1), p[i], "net = ", net[i]; net[i]}' data2data.csv
Because this is a csv file, FS = ',' or -F ','
In BEGIN block index value for array is set to zero. Next p and net arrays are created. These are indexed on NR(record numbers).
Then a for loop print (i-1), p[i], "net = ", net[i];net[i] works as you planned. The size of loop is less than NR (i<NR)for because arrays start from zero(for loop is being started form one)from 2 because first line is header line.
Thispipe in this case is similar to array indexed on NR(record numbers)useless use. Anohter thing your loop is good but limit should be NR not NF.