I have a file that has 1200 lines, with 170 boletos, but there are boletos that have 7 lines some 8 and 9 like I do to make the break. At the beginning of the line there are 3 letters dividing the breaks as in example ai below.

Letters
H - First Line that has to appear on all tickets
T - Beginning of the ticket
I - All lines

Next T starts new ticket

And the first line has to be fixed and appear on all tickets.

HBELLA VITA 12134963000167
TLAISE MONIQUE FERREIRA SZKULNY LAISE MONI
ITAXA DE CONDOMINIO
IFUNDO DE RESERVA
ITAXA BOLETO
ITAXA GARANTIDORA 4,25%
IFUNDO DE OBRAS
IFUNDO DE MANUTENÇÃO
TJULIANO RIBEIRO PEREIRA JULIANO
ITAXA DE CONDOMINIO



Can someone help me