Code:
$ cat treatment3.awk
BEGIN { FS=","; OFS=","
split("parmeter1,parmeter2,parmeter5,parmeter3,parmeter4,parmeter6,parmeter7,parmeter10,parmeter9,parmeter11,,parmeter12,parmeter15,parmeter14,parmeter13", ORDER);
}
!T { TITLE=$1 ; T=1 ; next }
/^[ \t]*,/ { split($2, Z, "=");
VALUE[Z[1]]=Z[2]; }
/;;/ { $0=""; T=""
for(X in ORDER)
{
if(ORDER[X]) $X=" "ORDER[X]"="VALUE[ORDER[X]];
else $X=""
}
$1=TITLE$1
$NF= $NF ";;"
print
}
$ awk -f treatment3.awk data
Treatment parmeter1=value, parmeter2=value, parmeter5=value, parmeter3=value, parmeter4=value, parmeter6=value, parmeter7=value, parmeter10=value, parmeter9=value, parmeter11=value,, parmeter12=value, parmeter15=value, parmeter14=value, parmeter13=value;;
Treatment parmeter1=value, parmeter2=value, parmeter5=value, parmeter3=value, parmeter4=value, parmeter6=value, parmeter7=value, parmeter10=value, parmeter9=value, parmeter11=value,, parmeter12=value, parmeter15=value, parmeter14=value, parmeter13=value;;
$