home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
cmplangm
/
1989_6
/
awk
/
xref.awk
< prev
Wrap
Text File
|
1988-10-10
|
764b
|
32 lines
#Original program courtesy Bruce Feist of Arlington VA
{
# remove non alphanumeric characters
gsub (/[`~!@#%\^&\*\(\)\+\|\-=\\\[\]{};':\",\./\<\>\?\/]/, " ")
# convert to upper case
for (i = 1; i <= 26; i++) # go through alphabet
gsub (substr (lowers, i, 1), substr (uppers, i, 1))
# add reference
for (i = 1; i <= NF; i++)
{
if ($i !~ /^[0-9]+$/ && done[$i] != NR) # check if number or done
{
done[$i] = NR # mark as done
xref[$i] = xref[$i] " " NR # add reference
}
}
}
BEGIN {
uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lowers = "abcdefghijklmnopqrstuvwxyz"
}
END {
for (i in xref)
print i ": ", xref[i]
}