Good Day Everyone,

I need a little help with coding a loop.

I have a page that read a txt file, the file looks like this:

HDR#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############
HDR#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############
HDR#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############
DTL#############SOME TEXT GOES HERE############

The initial code was made to read only for 1 Header ans as many details as the text file had, but now the file contains variable quantity of HDRs and DTLs.

How can i code a loop and output as separate readings for every HDR,

Ex.

HDR #1
DTL
DTL
DTL

HDR #2
DTL

HDR#3
DTL
DTL

This it's to later update a MS Acces table.

Thanks in advance for your help.

Leo