version 1.3, 1999/09/20 14:30:53 |
version 1.4, 1999/09/23 21:54:57 |
|
|
#!/usr/bin/nawk -f |
#!/usr/bin/nawk -f |
|
|
# used both by support.bld and by groups.bld, since the formats are similar |
# used by support.bld to generate the table in support.html |
|
|
# convert data like this (order doesn't matter except 0 at front) |
# convert data like this (order doesn't matter except 0 at front) |
# 0 |
# 0 |
|
|
# P Ontario |
# P Ontario |
# T Palgrave |
# T Palgrave |
# A R R # 1 |
# A R R # 1 |
|
# Z L0N 1P0 |
# O Consultant |
# O Consultant |
# I Ian F. Darwin |
# I Ian F. Darwin |
# M ian@darwinsys.com |
# M ian@darwinsys.com |
|
|
|
|
$1 == "C" { country = substr($0, 2); |
$1 == "C" { country = substr($0, 2); |
if (country != oldCountry) { |
if (country != oldCountry) { |
print "<TR><TD BGCOLOR=\"#FFFF00\" COLSPAN=6 ALIGN=CENTER><B>" country "</B>" |
print "<TR><TD BGCOLOR=\"#FFFF00\" COLSPAN=2 ALIGN=CENTER><B>" country "</B>" |
} |
} |
oldCountry = country |
oldCountry = country |
next |
next |
|
|
$1 == "P" { prov = substr($0, 2); next } |
$1 == "P" { prov = substr($0, 2); next } |
$1 == "T" { city = substr($0, 2); next } |
$1 == "T" { city = substr($0, 2); next } |
$1 == "A" { addr = substr($0, 2); next } |
$1 == "A" { addr = substr($0, 2); next } |
|
$1 == "Z" { zip = substr($0, 2); next } |
$1 == "O" { org = substr($0, 2); next } |
$1 == "O" { org = substr($0, 2); next } |
$1 == "I" { indv = substr($0, 2); next } |
$1 == "I" { indv = substr($0, 2); next } |
$1 == "B" { phone = substr($0, 2); next } |
$1 == "B" { phone = substr($0, 2); next } |
|
|
print "<TR>" |
print "<TR>" |
print "<TD>" |
print "<TD>" |
if (indv != "") |
if (indv != "") |
print indv "<BR>" |
print "Name: " indv "<BR>" |
print org "<BR>" addr |
if (org != "") |
print " <TD>" city "<BR>" prov |
print "Organization: " org "<BR>" |
print " <TD>" |
if (addr != "") |
|
print "Address: " addr "<BR>" |
|
if (city != "") { |
|
print "City: " city |
|
if (prov != "") |
|
print ", " prov |
|
if (zip != "") |
|
print " " zip |
|
print "<BR>" |
|
} |
if (phone != "") |
if (phone != "") |
print phone "<BR>" |
print "Phone: " phone "<BR>" |
print fax |
if (fax != "") |
print " <TD>" |
print "FAX: " fax "<BR>" |
if (email != "") |
if (email != "") |
print "<A HREF=\"mailto:" email "\">" email "</A>" "<BR>" |
print "Email: <A HREF=\"mailto:" email "\">" email "</A>" "<BR>" |
print "<A HREF=\"" url "\">" url "</A>" |
if (url != "") |
|
print "URL: <A HREF=\"" url "\">" url "</A>" |
print " <TD>" note |
print " <TD>" note |
} |
} |
|
|
|
|
prov = "" |
prov = "" |
city = "" |
city = "" |
addr = "" |
addr = "" |
|
zip = "" |
org = "" |
org = "" |
indv = "" |
indv = "" |
email = "" |
email = "" |