I have the below file content:
test.txt
Start Code
Test6
Test4
End Code
Start Code
Test1
Test2
Test3
End Code
Start Code
Test5
Test9
End Code
Requirement:
q. lines whose (it contains “Test2”) of file “test.txt”
Need to print the lines containing Test2 and the previous lines till “Start Code” & next lines till "End Code"
So the output should be:
Test1
Test2
Test3
Any idea on this would be a great help.
Thanks in advance!