read_data in loop

Hello everybody,

I want to minimize the energy of multiple input geometries. Therefore I loop
over several data-files via

"read_data $"

where the name of the data file is a variable. However, this results in the

"Cannot read_data after simulation box is defined"

and the LAMMPS help explains

"The read_data command cannot be used after a read_data, read_restart, or
create_box command."

While the explanation is clear to me, I wonder if and how I can loop over
different input geometries. Any help is greatly appreciated!

Best regards,