I have a file that looks like that
y
z
pattern1
line
1
1
1
patern2
x
k
What I want to do is print the content between the two patterns with the following restrictions
- Avoid printing the patterns
- Skip the next line after the first pattern
This means that my output file should look like this
1
1
1
So far I am able to print between patterns, ignoring them by using
awk '/pattern1/{flag=1;next}/pattern2/{flag=0}flag' file
Any idea on how to do it?