OL Learn

Trailing FF in datamapper

Data files will sometimes have trailing a combination of trailing FF and empty lines. How do I remove both in the datamapper? They cause the repeat loop to go out of bound.
There is an option to ignore CR/LF at end of file, but it also doesn’t seem to remove the traling FF

The trailing FF and CRLF are not always present, but it is the trailing FF which causes the most issues when they are found at the bottom of text data files. They force an additional empty page and cause some steps to be out of bounds.

How can I dynamically remove them in the datamapper if they are present in the original text file?


I think you can write a Boundaries script to filter out those empty pages created by extra FF characters.

  • In the Input Data section, tick the Cut on FF option
  • In the Boundaries section, set the trigger to On script

Use the following script expression:

var oneChar = boundaries.get(region.createRegion(1,1,1,1));
if(oneChar[0]!="") boundaries.set();

The script looks at the first character that follows a FF. If there is none, then the following page is necessarily empty. And the script only sets a new document boundary if the page is not empty.

This script has the added bonus of filtering out any extra FF characters within the entire job file (well it doesn’t actually filter them out: it just doesn’t mark them as new document boundaries.

Not sure if that will work for you but with the tests I ran here, it worked like a charm.

I have not been able to get this to work I am afaraid. The record trigger is set on the presence of the phrase “page: 1” at a specific location

Making changes as suggested breaks the record boundary.
In addition, the first character in the file or on each page is always empty

I suggest you contact our Support team and provide them with an anonymized sample data file so they can figure out the best way to handle the issue.
You might also refer them to this post so they can see what has been tried already.

Yes Support tells me scripting is outside the scope of OL Support when virtually nothing clever can be done without a bit of code.

Maybe it’s just me asking difficult questions ?

But I found a way to remove the trailing form feed in a Run Script in Workflow with vbscript.

Do I see a datamapper feature request here?

I am way ahead of you! :slight_smile:

The ticket is in our database and has your name on it. For reference, our ticket number is SHARED-67112.