Help for this page
perl -ne 'print scalar <> if /energy/' filename
perl -ne 'print ++$i,scalar <> if /energy/' filename