I have a text file named compare.txt where I want to extract the single line that follows every line that contains the pattern nmse_gain_constant.
compare.txt
nmse_gain_constant
One solution will be:
grep -A 1 nmse_gain_constant compare.txt | grep -v nmse_gain_constant | grep -v "\-\-"