Skip to content

Instantly share code, notes, and snippets.

@ork
Last active February 20, 2022 23:17
Show Gist options
  • Save ork/8508228 to your computer and use it in GitHub Desktop.
Save ork/8508228 to your computer and use it in GitHub Desktop.
Parse IEEE OUI vendor list to JSON
#!/usr/bin/awk -f
# Parse IEEE OUI vendor list to JSON
# http://standards.ieee.org/develop/regauth/oui/oui.txt
# ---
# Usage:
# $ chmod +x parseoui.awk
# $ wget http://standards.ieee.org/develop/regauth/oui/oui.txt
# $ ./parseoui.awk oui.txt > oui.json
BEGIN {
print "[";
}
/(hex)/ {
printf "{ \"oui\": \"%s\", \"vendor\": \"%s\"},\n", $1, substr($0, index($0, $3));
}
END {
print "]";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment