BEGIN { FS=" "; } NR == 1 { nf=split(FILENAME,f,".") print ""; print "
"; } { # # protect special chars # gsub(/&/,"\\&"); gsub(/>/,"\\>"); gsub(/,"\\<"); gsub(/"/,"\\""); gsub(/%/,"\\%"); nf=split($0,tag," "); tagkey[t]=tag[1];tagref[t]=tag[2];tagnum[t]=NR; print $1 " " $2 " line " NR >"tags.ref" n=split($2,w,"."); printf ("|%s| %s\n",w[1],$1,$1,$2); } END { topback(); print "\n\n\n\n"; } # # as main we keep index.txt (by default) # other candidate, help.txt # function topback () { printf("top - "); printf("back to help\n"); }