# # Generate participants list 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 < "countries.html" != 0) print $0 > "countries.html~" close "countries.html" close "countries.html~" while (getline < "CountryInst.csv" != 0) { ReportStatus[$1] = $2 ReportAuthor[$1] = $3 } close "CountryInst.csv" while (getline < "Head.html" != 0) { if (index($0, "__title__")) sub("__title__", "ELAG 2001 - Participants by Country/Institution") print $0 } close "Head.html" print "" print "" print "" print "" print "" print "" print "" print "" # print "
Participants by Country/Institution
 
" print "" print "" print "
Clicking the icon will generate a template for your ELAG 2001 Progress Report, you can download it and after filling it in, please e-mail it to elag2001@stk.cz. The yellow report icon is assigned to the first person from an institution who clicks the white icon. The dumb program does not recognize who is the boss and who just clicked as the first one.
Clicking this icon will show you your template again. Note that only one person per institution is expected to present a report ;-)
Thank you, everyone can read your report here
Country" print "
Institution
#Name" print "Workshops
" Rewrite=0 } { RepCode = repchar(substr($12,1,10) substr($5,1,25)) if (CountryCtr[$12]) if (InstCtr[$5]) print "" else { print "" $5 "" if (ReportStatus[RepCode]) {} else { ReportStatus[RepCode]="0" Rewrite=1 } nInst++ } else { CountryAnchor = $12 gsub(" ","_",CountryAnchor) print "
\n" $12 "" if (ReportStatus[RepCode]) {} else { ReportStatus[RepCode]="0"; Rewrite=1 } nCtry++ print "" $5 "" nInst++ } ++InstCtr[$5] ++PartCtr RepAuth = repchar(substr($2,1,5) substr($3,1,5)) print "" ++CountryCtr[$12] "." print "" if (ReportStatus[RepCode] =="0") print "" else if (ReportAuthor[RepCode] == RepAuth) if (ReportStatus[RepCode] =="T") print "" else print "" print "" $1 "" print "" $2 " " $3 "" if ($25 == "#f0b66c") print " (substitute)" print "" print "" $16 " (" $17 ")" } END { print "" print "" print "
" print " 
There are " PartCtr " participants from " nInst " institutions from " nCtry " countries registered

 " # insert the footer while (getline < "Foot.html" != 0) print $0 close "Foot.html" print "
" "date +'%a %d %b %Y %H:%M:%S'" | getline timestamp print "   Last updated: " timestamp " CET\n\n" # Rewrite CountryInst.csv if (Rewrite==1) { for (i in ReportStatus) print i ";" ReportStatus[i] ";" ReportAuthor[i] > "CountryInst.csv" close "CountryInst.csv" system ("sort -o CountryInst.csv CountryInst.csv") } }