#
# This script generates html pages simulating PowerPoint presentation
# of a paper presented at ELAG seminar
# It generates a title page named Show.html and "last" html
# pages named Slide1.html to Slide"last".html
# The PowerPoint presentation pictures converted to gif format are
# expected to be found in the directory Papers/"finame""faname",
# the generated pages are placed to the same directory.
#
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 = ";"
# generate title page
filenm= repchar(finame) repchar(faname) "/Show.html"
# read in the header
while (getline < "/www/www-data/elag2001/Papers/PapHead.html" != 0) Head[++Nhdln] = $0
close "/www/www-data/elag2001/Papers/PapHead.html"
# read in the footer
while (getline < "/www/www-data/elag2001/Papers/PapFoot.html" != 0) Foot[++Nftln] = $0
close "/www/www-data/elag2001/Papers/PapFoot.html"
# read in the author record
while (getline < "/www/www-data/elag2001/particip.csv" != 0) {
if ((finame == $2) && (faname == $3)) {
affil = $5 ", " $12
ctry = $12
}
}
close "/www/www-data/elag2001/particip.csv"
author = finame " " faname
#
"date +'%d-%m-%Y'" | getline DCdate
# start creating page
for (i=1; i<=Nhdln; i++) {
line = Head[i]
if (index(line, "__title__")) sub("__title__", title , line)
if (index(line, "__date__")) sub("__date__", DCdate, line)
if (index(line, "__author__")) sub("__author__", author, line)
if (index(line, "__affil__")) sub("__affil__", affil, line)
print line > filenm
}
# generate list of slides
for (i=1; i<=last; i++) {
print "" i "
" > filenm
}
# right hand side of titlepage
print "\n
" > filenm print "