I have a file that looks like this:

> 
> %Labelinfo
> 
> 
> string1
> 
> 
> string2
> 
> 
> %Labelinfo2
> 
> 
> string3
> 
> 
> string4
> 
> 
> string5
> 
> 
> 

I would like to create dictionary that has key a string that is %Labelinfo, and value that is a concatenation of strings from one Labelinfo to next. Basically this :

{%Labelinfo : string1+string2 , %Labelinfo : string2+string3+string4}

Problem is that there can be any number of lines between two "Labelinfo" lines. For example, between %Labelinfo to %Labelinfo2 can be 5 lines. Then, between %Labelinfo2 to %Labelinfo3 can be, let's say 4 lines.

However, the line that containes "Labelinfo" always starts with the same character, for example %.

How do I solve this problem?