I have an output for a command as below.
Heading1
I am one value.
I am another value.
I am third value.
Heading2
I am some value.
I am someother value.
I am new value.
Heading3
As we can see, there is a space in the beginning of the line if it is not a heading. I am trying to extract all the values under Heading1. I need the output as,
I am one value.
I am another value.
I am third value.
If I try the command,
grep mycommand | heading1
It gives me only the Heading1 line.
UPDATE:
I know, I have to extract the string from the starting of Heading1
. But, I do not know the ending string (i.e, here I have mentioned as Heading2, but I won't be knowing it).
All I know is, I have to extract everything till the next heading which starts in a new line.