Hi, welcome to LQ!
Given the data above something like
Code:
egrep "^I=|NO CONVERGENCE|MAXIMUM NUMBER OF ITERATIONS REACHED" file
should do. You'd be getting the I=2, too, because there's no
multi-line match with a back-reference here.
If the file structure were clearer we could probably use an
awk script to eliminate the the "successful" iterations number
from the output.
Cheers,
Tink