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