IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Flextext - Repeated Split, Records with Batch Summary Record Options · View
diggers
Posted: Sunday, August 25, 2019 6:33:37 PM
Rank: Member

Joined: 8/26/2017
Posts: 11
Location: UK
I have a fixed width text file where each record type is identified by the first character. Record type 1 are individual transactions and they are in batches, the details of the batch are record type 2. I need to map out this format using Flextext but the batch detail (record type 2) is a summary, i.e. sequentially it comes after the related transactions (record type 1), not at the beginning.

If I use the repeated split and set the "line starts with" as 2, then it orpans the first record 1s, then treats record 2 as the batch header, and includes the record type 1s which follow it - so the whole thing is wrong. See the first picture attachment.

What I need to do seems to be either, do a repeated split, "line starts with" 2 but in reverse, i.e. from the bottom up, or I probably have to reverse the order of the lines in the source file. The desired result is in the second screenshot / attachment.

Am I missing something? It can't be this difficult - any help / advice appreciated.



diggers attached the following image(s):
Incorrect Result.JPG
Desired Result.JPG

K101
Posted: Monday, August 26, 2019 7:17:46 AM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 564
To start with, you want to try to get the right batches. This can be done without using FlexText, using the group-ending-with function as demonstrated by the following example.

To process the two different record types, pass each individual row into its’ own serialized string processing component. That is, create two FlexText components; one for each record type. Then, pass the complete individual row (as text) into each based on whether or not it starts with “2”.

File Attachment(s):
example.zip (4kb) downloaded 69 time(s).

K101 attached the following image(s):
example.png

Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.