Sorry for the late response.
I tried to generate the new psf file based on the suggestions by lennart and rmv. The system consists of the solute molecules in a water box. I started from a water box and then I add the solute molecules randomly. After the addition of solute molecules, I remove overlapping water molecules. If I setup the system again using the same procedure, the solute molecules are placed randomly again. Therefore, it is not possible to generate the same system again.
However, I found a quick way to add water donors in the psf.
I edited the donor section of the psf using awk and it works. I need to change the Ndonors and the list of the donor atoms only.
Thanks a lot for all your suggestions.