BEGIN{if (ARGC!=4) exit;
stud_file=ARGV[2];ARGV[2]="";grade_file=ARGV[3];ARGV[3]="";OFS="";
command="wc -l " stud_file;
command | getline temp; split(temp,TEMP); sn=TEMP[1];
print "
Maple data for lab #4";
print "Maple Data for Lab 5
"
print "
";
j=0}
{if (NF==0) next}
{if (j==0) {A="Constraint: "$1"=1"}}
{if (j==1) {B="Objective function: "$1}}
{if (j==2) {C="Number of sols: "$1" Max. value: "$2" Min. value: "$3;
j=-1;
getline Q < stud_file; split(Q,name_mail," ");
print name_mail[1]," "C >> grade_file;
print " "A" "B >> grade_file;
print ""name_mail[1]" | "A""B"
|
";sn--}}
{j++}
{if (sn==0) exit}
END{if (sn>0) print "The last " sn " students have no data.";
if (ARGC!=4) print "Number of files incorrect.";
print "
"}