($1 == "\\h"){ print "=> oeb.py?" startref"-"chapter"%3A"verse section; book = substr($0, 4); print "## " book; gsub(/ /, "%20", book); verse = 1; chapter = 1; section = ""; startref = book"%20"chapter"%3A"verse } ($1 == "\\c"){chapter = $2; verse = 1} ($1 == "\\v"){verse = $2} ($1 == "\\s"){ if(section){ print "=> oeb.py?" startref"-"chapter"%3A"verse section; } section = substr($0, 3); startref = book"%20"chapter"%3A"verse } END{print "=> oeb.py?" startref"-"chapter"%3A"verse section;}