(I edited the question for clarification)
I would appreciate suggestions on how to implement the following in python: given the text
> first
> second
third
fourth
> fifth
> sixth
> seventh
I would like to get two subtexts:
first
second
and
fifth
sixth
seventh
i.e. given an input of some lines of text, the output should be the blocks of lines which start with >
. A "block" in my definition here is a set of consecutive lines all starting with >
. In the example above since the third line doesn't start with >
it "cuts" the above two lines into a single block. The second block then starts on the first line which starts with >
, i.e. the fifth line.