To elucidate the hole doping mechanism, we have systematically studied the Ni and Cu K-edge x-ray-absorption spectra in doped Nd 2 NiO 4 , La 2 NiO 4 , and La 2 CuO 4 . We find a significant difference in the character of the doped hole between the nickelates and cuprate. We observe that both strontium substitution and introduction of excess oxygen lead to a shift of the Ni absorption edge to higher energies, by nearly 3 eV in NaSrNiO 4 . This result demonstrates that the doped holes, in addition to the O 2p character, have a substantial amount of Ni 3d character (30-40%). The intensity of the 1s-3d transition increases upon doping, consistent with increasing number of d holes