Best way to extract many lines

I have a text file that can have between 3 and N lines, where
Line 1: BANNER…
data
data
data
data

Last line: END OF FILE…

The “data” lines are always the same length.

What is the best way to extract these lines so that they fit into an A4-sized Print Section and that all data appears on the page, regardless of how many pages are generated?

TESTE_ECT445_20241202 - Copia.TXT (24.7 KB)

Sample file

format of each data in the lines, except BANNER and FINAL lines
Data1 → 1-9
Data2 → 10-24
Data3 → 24-32
Data4 → 33-60
Data5 → 61-52
Data6 → 63-68

I would create a detail table that contains all the lines, except for the first one and the last one.
image
The Goto next NOT FINAL step is the only one that needs explanation: it uses a Regular expression to skip to the next line that does not contain the word “FINAL”:
image

The Regular Expression is ^((?!FINAL).)

1 Like

Good morning, Phil. Thanks for the response, would you mind sharing this DM file so I can understand it better? I haven’t worked with the loop and GO TO steps yet.

Here you go:
LinesAsDetailTable.OL-datamapper (4.7 KB)

1 Like

A good start to the year to everyone!
Analyzing the file here, I noticed that when assembling the pivot table, the first line ends up being duplicated, as shown in the image below. I verified in the DM that in fact records 1 and 2 end up looping through the first line of data, in this case line 2 of the file, twice.
How could you prevent this from happening?

Did you make changes to the looping provided by Phil?
I just looked at the DM he provided you and don’t see this duplication.
Can you share your new DM with a anonymized data sameple that reproduce the problem?

Yes, I made some changes. I will send it to you by PM

I downloaded the unmodified file again and you can notice that when changing the records in position 1 and 2 it displays the duplicate data

It does look like an issue.
I suggest you open a technical support ticket through our website.

Okay, I’ll open it here.

Ticket opened
Ticket #1686567

I think this version fixes the issue. I just made sure that the initial Goto step’s condition matches the one inside the loop.

I’ve altered the regex to ignore any line that starts with either FINAL or BANNE.

LinesAsDetailTable.-Fixed.OL-datamapper (4.7 KB)

1 Like