I have to search for a specific string in the reverse order and print it.
In the below example I want to search from the pattern not in order
until the pattern number of
.
Example: input file contains:
number of characters a[1]
reg1
reg2
reg3
info a[1] is not in order
number of characters a[3]
reg1
reg2
reg3
info a[3] is in order
number of characters a[2]
reg1
reg2
reg3
info a[2] is not in order
output should be:
number of characters a[1]
reg1
reg2
reg3
info a[1] is not in order
number of characters a[2]
reg1
reg2
reg3
info a[2] is not in order
a[3]
is missing in the output. Can you elaborate?