#! /usr/bin/gawk -f # Last edited on 2004-02-04 07:20:59 by stolfi BEGIN { # User must define "-v fname=..." printf "# === %s =============================================================\n", fname; gsub(/^[0-9]+[-]/, "", fname); gsub(/[.]htm/, "", fname); book = fname; gsub(/[-][0-9]+/, "", book); book = toupper(book); chapnum = fname; gsub(/^[a-z]+[-]/, "", chapnum); chapnum = chapnum + 0; } /^ *$/ { next; } // { gsub(/[\011]/, " "); gsub(/[|] *$/, ""); gsub(/^ *[|]/, ""); gsub(/<[Bb][Rr]>/, ""); gsub(/>[| ]+, "> <"); gsub(/[&]nbsp;/, " "); gsub(/^[ ]+/, ""); gsub(/[ ]+$/, ""); gsub(/[ ][ ]+/, " "); } /^<[\/]*HTML>$/ { next; } /^<[\/]*html>$/ { next; } /^<[\/]*HEAD>$/ { next; } /^]*>$/ { next; } /^<[\/]*BODY[^<>]*>$/ { next; } /^<[\/]*body[^<>]*>$/ { next; } /^