This question already has an answer here:
I have an example dataset where a section has fields beginning with "something". I would like to obtain all of the lines in each "something" section when matching a specific string of "1234".
I was thinking that I could search for "1234" and print all lines before and after until matching "something".
something like this one 1234 abcd something like this one zyxw 1234
otherthings otherthings otherthings something like this one 1234 abcd something not like this one xxxx yyyy something not like this one xxxx yyyy something like this one 1234 abcd otherthings otherthings otherthings