# # Generate report template for the respective institution/participant # 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=";" InstType["NatLib"] = "National Library" InstType["UniLib"] = "University Library" InstType["ResLib"] = "Research Library" InstType["Library"] = "Other Library" InstType["Consort"] = "Consortium" InstType["SWDevelop"] = "Software Developer" InstType["Ministry"] = "Ministry/Government" InstType["Consult"] = "Consultant" InstType["Other"] = "Other" filename= "/www/www-data/elag2001/Templates/" par ".html" # read in the header while (getline < "/www/www-data/elag2001/RepHead.html" != 0) Head[++Nhdln] = $0 close "/www/www-data/elag2001/RepHead.html" # read in the footer while (getline < "/www/www-data/elag2001/RepFoot.html" != 0) Foot[++Nftln] = $0 close "/www/www-data/elag2001/RepFoot.html" # "date +'%d-%m-%Y'" | getline DCdate } { RepCode = repchar(substr($12,1,10) substr($5,1,25)) RepAuth = repchar(substr($2,1,5) substr($3,1,5)) if ( (RepCode == par) && (RepAuth == auth) ) { # start creating page for (i=1; i<=Nhdln; i++) { line = Head[i] if (index(line, "__title__")) sub("__title__", "ELAG 2001 - Progress Report of the " $5, line) if (index(line, "__date__")) sub("__date__", DCdate, line) if (index(line, "__name__")) sub("__name__", $2 " " $3, line) if (index(line, "__inst__")) sub("__inst__", $5, line) print line } print "
ELAG Contact Person:
" $1 " " $2 " " $3
if ($4) print " (" $4 ")"
print ", " $15 " , phone:" $13
if ($14) print ", fax:" $14
print "
Institution Type: " InstType[$6] "
Mission Statement
"
print "\n"
print "
Reported by " $2 " " $3 print "<" $15 ">" print "\n" print "
Your_home, 24 April 2001" # close the main table print "" # insert the footer for (i=1; i<=Nftln; i++) print Foot[i] print "" "date " | getline timestamp print " Generated: " timestamp "" print "