Scott are you picking up everything on the line as one detail template or are you picking up "some other data" as the detail and the customer number as an append?
If you set it up vie the 1st way you might have to change your model around.
Normally the lowest level of data is the detail record, then anything above would be an append, and any thing after is a footer. The page header is for anything you need that shows up at the top of each page.
If you already use the second method there is something else wrong.
Post back & let us know how you make out.
Hi Scott and welcome to the forum!
Are these line really all part of one single row long record but have been wrapped for display?
If so you might find the Monarch Utility useful to pre-process the file (I'm guessing the the EOL markers will be different where a record ends) and if you have the Pro Monarch 9 you could them read the resulting line as a database.
There are other possible options but more than likely we would need to be assessing a good sample of what you are dealing with to be able to propose a solid solution - they can become very dependent on layout and content for this sort of file in my experience.
I'll summarise what I think I understand of it so far then suggest a couple of ideas for you to consider.
Each record has at least 2 lines, some may have a third line, they are all part of a single record and no two lines share overlapping data fields. i.e. if there are three lines the data on each line are unique and lines B and C are not both possible complete detail lines hanging off line A.
I assume you have a way of trapping line A in a two line template that would not also potentially trap line B or line C. That is important. Your trap for DETAIL must either successfully trap LINE As ONLY or possibly line Bs only. It must never trap Line Cs.
Even if you detail trap on B Lines, A lines as APPENDS will still require a unique trap as fas as I can tell, so we may as well seek a solution based on trapping on A for the detail for all 3 possible lines.
Making that assumption, you would need a 2 line sample for the template. Trap the first line and define the fields.
For the second line grab the entire line (except perhaps the repeated first Account Number) and define a character memo field that grabs the whole line. Right click on the field and go to the advanced options tab to set an 'end on' value that that will encourage the field to stop reading lines when it encounters another detail template - the next record's A line.
You will now have one large field that will include C lines when they occur. The large field will need slicing and dicing to extract the individual field you require using Calculated fields in the table window.
Absent a representative sample it's a little difficult to suggest exactly what to use for that but as you have V9 a starter function would be TextLine to identify the B and C lines separately and then functions like the LSPLIT and RSPLIT tools will likely be very useful. In general the String functions group and probably the Conversion functions are your tools of choice for slicing and dicing.
If you have done it before you will likely need no help. If not, once you see what you have got from the initial extraction post some representative samples and people will be able to assist with a way to move forward based on your report's data structure post extraction.