I have very large text files of the form below:
>randomheader1 some info flag1
data
moredata
someextradata
>randomheader2 some info flag2
littledata
somedata
>randomheader3 some info flag1
one
two
three
four
>randomheader4 some info flag3
....
I want to get the output of the lines following the line containing flag1
into another file, such as:
>randomheader1 some info flag1
data
moredata
someextradata
>randomheader3 some info flag1
one
two
three
four
I've been reading to find a solution, I've checked this answer, however since the matching patterns I'm looking for are the same characters (namely >
), it didn't work. I'm looking for a solution in bash.