If I have a file that contains some text data such as
PATTERN1
TEXT1
PATTERN1
TEXT2
PATTERN2
How would I select the TEXT2 data from this file I know PATTERN1 and PATTERN2 ? I have tried using awk as mentioned here, but it prints both TEXT1 and TEXT2.