Script to parse IANA Protocol-Numbers

I don't suppose that anyone has a script that they use to parse IANAs
Protocol-Numbers and Port-Numbers text files? I have been trying to
write my own but the docs are not very well formatted.

Thanks,
Dan