tags:

views:

55

answers:

0

How do I print a line which matches a particular pattern and the line before it?

I do have a dump like this:

Apple:Orange=9942501133;
Fault Code 9
Apple:Orange=9942501144;
Fault Code 9
Apple:Orange=9942501155;
Apple:Orange=9942501166;
Apple:Orange=9942501177;
Fault Code 9
Apple:Orange=9942501188;
Apple:Orange=9942501199;
Apple:Orange=9942501200;
Apple:Orange=9942501211;
Fault Code 9
Apple:Orange=9942501222;

The output result to be the above line of "Fault Code 9" with Fault Code 9 included:

Apple:Orange=9942501133;
Fault Code 9
Apple:Orange=9942501144;
Fault Code 9
Apple:Orange=9942501177;
Fault Code 9
Apple:Orange=9942501211;
Fault Code 9