Comment fixes from Larry Rosenman" <ler@lerctr.org>.
This commit is contained in:
parent
8a35cbe1db
commit
87523ab8db
@ -1,4 +1,4 @@
|
|||||||
# $Id: ouiparse.awk,v 1.1 2000/08/23 06:02:23 thomas Exp $
|
# $Id: ouiparse.awk,v 1.2 2000/08/23 13:44:14 thomas Exp $
|
||||||
#
|
#
|
||||||
# ouiparse.awk
|
# ouiparse.awk
|
||||||
# Author: Lawrence E. Rosenman <ler@lerctr.org>
|
# Author: Lawrence E. Rosenman <ler@lerctr.org>
|
||||||
@ -10,10 +10,9 @@
|
|||||||
# manufacturer text);
|
# manufacturer text);
|
||||||
# the table name is set by setting the AWK variable TABLE
|
# the table name is set by setting the AWK variable TABLE
|
||||||
#
|
#
|
||||||
# we translate the character apostrophe (') to space inside the company name
|
# we translate the character apostrophe (') to double apostrophe ('') inside
|
||||||
# to avoid SQL errors.
|
# the company name to avoid SQL errors.
|
||||||
#
|
#
|
||||||
# match ONLY lines that begin with 2 hex numbers, -, and another hex number
|
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
TABLE="macoui";
|
TABLE="macoui";
|
||||||
@ -27,6 +26,7 @@ END {
|
|||||||
printf "COMMIT TRANSACTION;";
|
printf "COMMIT TRANSACTION;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# match ONLY lines that begin with 2 hex numbers, -, and another hex number
|
||||||
/^[0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F]/ {
|
/^[0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F]/ {
|
||||||
# if (nrec >= 100) {
|
# if (nrec >= 100) {
|
||||||
# printf "COMMIT TRANSACTION;";
|
# printf "COMMIT TRANSACTION;";
|
||||||
@ -47,7 +47,7 @@ END {
|
|||||||
Company=Company " " $i;
|
Company=Company " " $i;
|
||||||
# Modify any apostrophes (') to avoid grief below.
|
# Modify any apostrophes (') to avoid grief below.
|
||||||
gsub("'","''",Company);
|
gsub("'","''",Company);
|
||||||
# Print out for the 'C' structure in mac.c
|
# Print out for the SQL table insert
|
||||||
printf "INSERT INTO %s (addr, name) VALUES (trunc(macaddr \'%s\'),\'%s\');\n",
|
printf "INSERT INTO %s (addr, name) VALUES (trunc(macaddr \'%s\'),\'%s\');\n",
|
||||||
TABLE,OUI,Company;
|
TABLE,OUI,Company;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user