I am trying to print text after a pattern match till it matches other pattern several times in a file. I have tried to modify the script given here but failed to do it.
eg.
The content of file1.txt
example text
more example
pattern1
important text
very important
need this too
pattern2
i dont require this
junk text
more junk
pattern1
important text
very important
need this too
pattern2
junk
Expected Output
pattern1
important text
very important
need this too
pattern1
important text
very important
need this too
can anyone suggest the edit?
Thanks.