Mapping tagged text data in Designer

I’m very new to OL Connect Designer and need to create a print template with data from a text file that looks like this:

<CP>000000000017990901030000002090902NNNNNN000000000000B
<RK0,114983005>
<LT199> 
<LT1> Tax
<LT2>94890000
<LT3>1799090000
<LT2801>Y
<LT2803><LT1> Notification for Client ID : <LT2>
<LT2804>test@aol.com

The fields won’t be based on location so I’m assuming the only other way to extract them will be with a javascript. So my question is, what would be the script that extracts the value after “< LT1 >” and before the following “<” on the next line, as an example, that I could then apply to all the < LT > tags to extract the data that follows them.

The < CP > tag is the start of a new record, and this is just a very small sample of all the possible tags so I want to make sure I am doing it correctly before mapping them all.

If there is a better way of mapping this type of data then I’m all ears as well!

Hello @Laura2795,

First of all, welcome to the OL Forum communicaty!

As for the question asked; splitting the data into records based on the <CP>-tag shouldn’t be difficult but in case the tags existing on the following lines can basically be placed anywhere in any order will make it difficult to extract this data.

Thanks Marten :smiling_face:

I figured out how to switch between the records using the CP tag, but yes the rest of the tags position in the data won’t always be the same or some won’t be in the data at all.

Would I be able to base the fields off JavaScript instead of position to extract the values? I thought it might work to extract everything after a tag but before the following tag?

But again, very new to this so have no idea what that script would be, or if that’s even possible!