# # Generate participants list from the 'Ucastnici.csv' sorted by # name # BEGIN { FS="|" # create backup copy while (getline < "ucas-e.htm" != 0) print $0 > "ucas-e.htm~" close "ucas-e.htm" close "ucas-e.htm~" # copy the header "date +'%d.%m.%Y %H:%M'" | getline timestamp while (getline < "ucas-e_head.htm" != 0) { sub("__date__", timestamp) print $0 } close "ucas-e_head.htm" print "" } { NParticip++ # generate a line of Participants list prtline = "" print prtline } END { print "
" NR ". " $2 " " $3 "" if ($12 != "") prtline = prtline ", " $12 "" prtline = prtline ", " $6 "
" print "" # insert the footer while (getline < "ucas-e_foot.htm" != 0) print $0 close "ucas-e_foot.htm" }