1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#!/bin/nawk
# cleans up any leading crap before <TITLE> line in stream from tk2html
/^<TITLE>/ { go = 1 }
/^<table>*/ {
getline ln
numf = split (ln, spln)
if ( ln !~ "Name: *" )
{
ind = 0
inc = 4
print "<table cellpadding=5>"
while ( ln !~ "^</table>" )
{
for (i = 1; i <= numf; i++)
{
tablns[ind] = spln[i]
ind++
}
getline ln
numf = split (ln, spln)
}
for (i = 0; i < inc; i++)
{
print "<td valign=top>"
for (j = i; j < ind; j += inc)
print tablns[j] "<br>"
print "</td>"
}
print "</table>"
}
else
{
print "<pre>"
while ( ln !~ "^</table>" )
{
print ln
getline ln
}
print "</pre>"
}
next
}
go == 1 { print $0 }
|