BEGIN{ YES = 1; NO = 0; MARK = " " a[1] " <----------------"; } newLine = withoutHtml( $0); newLine = withoutSpaces( newLine); if(!(newLine == "")) { if(index(newLine, "Category")>0){ step = 1; key = "Category"; } if(index(newLine, "Format")>0){ step = 1; key = "Format"; } if(index(newLine, "Description")>0){ step = 1; key = "Description"; } if(index(newLine, "R4RS Compliance")>0){ step = 1; key = "R4RS Compliance"; } if(step == 0) if( begin = NO) print newLine; if(step == 2) if(begin == NO) { print key ": " newLine; step = 0; } if(step == 1) step++; } } function withoutHtml( str, txt, txtOut) { txt = str; txtOut = ""; while(index(txt, "<")>0) { txtOut = txtOut substr(txt, 0, index(txt, "<")-1); txt = substr(txt, index(txt, "<")+1); txt = substr(txt, index(txt, ">")+1); } return txtOut; } function withoutSpaces( str, txt) { txt = str; while((substr(txt, 0, 1)==" ")&&(length(txt)>1)) { # print "#" txt "#"; txt = substr(txt, 2); } if(length(txt)==1) { if(txt == " ") return ""; else return txt; } else return txt; }