PDB parsing codeC++ and perl code for parsing PDB files. The code is tailored for gathering relevant data for alpha helices, but it shouldn't be too hard to tailor it to your needs.
getPDBSpecs.pl - by Tony Kuo
If you modify any of these and think it might be useful to others, please send it to me and I'll post it here (with credit of course ;)
Also, if anyone refactors this code to improve it, please let me know.
You will need to consult the PDB file structure guide.
You may also want to have a look at this parser in Python. It's not mine, nor have I used it, but it's been published, so it must be decent.