Recent discovery of the signature of 80 K superconductivity in La3Ni2O7 single crystals under high pressure sheds the light on the realization of high temperature superconductors from Ruddlesden–Popper nickelates. Here, we demonstrated the realization of selective fabrication of Nd0.8Sr0.2NiO3 perovskite films and (Nd0.8Sr0.2)2NiO4 Ruddlesden–Popper films from one ceramic Nd0.8Sr0.2NiO3 target simply by controlling the growth temperature. Our results further show that the as-grown Nd0.8Sr0.2NiO3 films can be transformed to (Nd0.8Sr0.2)2NiO4 by annealing in air at 1000 °C. Nd0.8Sr0.2NiO3 and (Nd0.8Sr0.2)2NiO4 films were found to be metallic and insulating, respectively. X-ray photoelectron spectroscopy results reveal that the as-grown (Nd0.8Sr0.2)2NiO4 films contained NiO impurity, which can be removed by high temperature annealing. X-ray absorption spectroscopy measurements indicate a lower Ni valence state and weakened hybridization between Ni–O in (Nd0.8Sr0.2)2NiO4 films. Substrate lattice strain strongly affects the stability of Nd0.8Sr0.2NiO3 and the formation of (Nd0.8Sr0.2)2NiO4. These results suggest an important role of thermodynamic principles in the growth and post-annealing of nickelate films. These findings provide an approach to obtain Ruddlesden–Popper series nickelate films and offer certain impetuses to the development of nickelate superconductivity.