in reply to Re: Insert newline
in thread Insert newline

Yes, the input format is correct as you wrote. Additionally there are some lines in other formats in this huge file which will be excluded through the first "if". There can be more than one title line, the script always takes the last one (resp. the next one to the first item which belongs to the title) - this is provided through the second "if".
Unfortunately some items start not on a new line but follow the previous item on the same line. That is why I try to make new lines there (the first two regexes). This seems to be somehow ignored later: though these lines come as a new lines in the output they are not preceded by "title followed by semicolon" as needed.
Cannot solve this, need your help.
Thanks in advance. VE