M := ImportMatrix("data.csv",source=csv); M(..,6) := < "Total", seq( add(M[i,j], j=1..5), i=2..5 ) >; ExportMatrix("data_out.csv",M,target=csv);