in reply to Rearrange the residue number of a pdb file according to the residues names
PDB file format description might be useful. (if not for the OP then for those wanting to know more)