# # Generate Progress Report authors by country/institution # from the 'particip.csv' # function repchar(s1) { s2="" for (i=1; i<=length(s1); i++) { s = index(" /().'",substr(s1,i,1))>0 ? "_" : substr(s1,i,1) s2 = s2 s } return s2 } BEGIN { FS=";" while (getline < "CountryInst.csv" != 0) { ReportStatus[$1] = $2 ReportAuthor[$1] = $3 } close "CountryInst.csv" } { RepCode = repchar(substr($12,1,10) substr($5,1,25)) RepAuth = repchar(substr($2,1,5) substr($3,1,5)) if (ReportStatus[RepCode] =="0") print $15 ";1;" $12 ";" $5 ";" $24 ";" $2 " " $3 else if (ReportAuthor[RepCode] == RepAuth) if (ReportStatus[RepCode] =="T") print $15 ";2;" $12 ";" $5 ";" $24 ";" $2 " " $3 }