Create an index group with the desired residues. This is a generic feature of just about any GROMACS analysis program. Or, in this simple case, you already have the values you want as a subset of the analysis already performed, so just parse those lines of interest from the output file.