You could use the loop as follows which puts the header rows into a header table and row data into a rows table, linking on HdrId. Datatmp is the name of the inline table I used for testing - it just has the raw data in it.
For i = 1 to NoOfRows('Datatmp')
Data: LOAD $(i) as RecordId, RawData as InspectedData, if(left(RawData,4) = 4600, 'H', 'D') as DataType, if(left(RawData,4) = 4600, $(i), peek(HdrId)) as HdrId resident Datatmp where RecNo()=$(i);
Headers: NOCONCATENATE LOAD HdrId, InspectedData as HeaderInfo resident Data where DataType='H' and left(Lookup('InspectedData','RecordId',RecordId+1,'Data'),4) <> 4600;
Rows: NOCONCATENATE LOAD RecordId, InspectedData as RowData, HdrId resident Data where DataType='D';