Aggregate title to an archive.log

Hello how are you, i have a question i have a file ale.log and i want to agregate a title and later a space when the text is over and put another title (when the text is over) how can i do this? thank you
Example

Last ------>(Title) i want to agregate
pupu pupu pupu pupu
pupu pupu pupu pupu

                    ------> \(space\) i want to agregate

Su ------>(Title) i want to agregate
popo popor popo popo
popo popo popo popo

I'm sorry, but your question isn't very clear. Can you show sample input and sample output as you would like it to be? Also explain under what circumstances something is added of modified. By "aggregate" do you simply mean "add" or should the contents of the file somehow be summarized (this is what is often meant by aggregation)?