How to create an index file for 1st and 5th carbon of the 1st lipid molecule in a lipid bilayer

GROMACS version:2018.1
GROMACS modification: No
Hello
I have a homogenous lipid bilayer containing 128 lipid molecules.
I need to create index files for all of the 128 lipid molecules individually.
For the 1st lipid molecule index file the 1st and the 5th carbon need to be selected to describe a vector. Similarly for 128 such lipid molecules 128 index file needs to be created.

How should I approach?

Thanks in advance

See here for some good examples.
Using a .gro file, you can make selections based on atom numbers, e.g. in gmx make_ndx, you might select the first and second 100 atoms by:

> a 1-100
> a 101-200
> q

selections from each group then is easy. Let’s say you need to select C1 and C5 from the first 100 atoms (called group number e.g. 15)

> 15 & a C1
> 15 & a C5

Good luck.

thanks a lot for your suggestions and time. I will work on it.