Using frame numbers from index file for naming output files

GROMACS version: 2022.4
GROMACS modification: No

Hello everyone,

Is it possible to parse the frame numbers in the <frames.ndx> file supplied with the -fr flag to the gmx trjconv command so that the frame numbers can be included while naming the output files in conjunction with the -sep flag?

I would like to execute the following command:

gmx trjconv -f <system.trr> -s <topology.tpr> -fr <frames.ndx> -sep yes -o <frame_number.gro>

And get the output as (for e.g.) 11.gro, 29.gro, 37.gro, etc.

Please let me know if there is a way of achieving this. Thank you very much.

An acceptable workaround would have been directly supplying the frame numbers recursively to the gmx trjconv command at each iteration, but I think it is not feasible to do so without using an index file.