Remove LF and FF at end of input document

Hi folks,

I’m having a problem with my DataMapper flow - it works perfectly for the majority of the records it finds within the input (source) document, but always processes the last record in the file incorrectly. I’ve managed to narrow this down to the fact that the document ends with a LF and then an FF. If I manually strip those out of the source document, the file processes just fine for every record within it.

I’m assuming that a script step can be built in to my DataMapper flow somehow to do this, but I’m not much of a Javascript guru I’m afraid, so don’t really know how to go about this.

Can anyone provide me with some guidance at all please?

Many thanks,

Rich

Use the Advanced Search and Replace action in the Workflow to remove these characters at the beginning of the line This could also remove empty lines that don’t necessary occurs at the end of the file… The string to search will be a Control Character (Right click mouse > Control Characters > New Line (CRLF) )

Or use Add/Remove Text action in Workflow to remove the 1 line at the end of job file.

Once the line is stripped, you can then feed your new data file to the Data Mapper.

Alternatively, in 2018.1 there’s a new feature to simply ignore a CR/LF at the end of the file. This is available within the datamapper for text file inputs.

http://help.objectiflune.com/en/pres-connect-user-guide/2018.1/#cshid=33040

Hi Rob,

Many thanks for that, that appears to do the trick! I used a variation on your second suggestion, and included an action to strip off the last two characters in the file, which were a LF and FF, and were skewing the results. Seems to be working fine.

AlbertsN - thanks for your suggestion, I did try the “Ignore CR/LF” option but it didn’t seem to work, perhaps because for me the final character is a ‘FF’?

All the best,

Rich

Yeah, that would probably be the reason. My brain didn`t have enough coffee in it to see that was a FF and not a CF!

Glad you`ve got it working!

I’ve complained about this aberrant behavior in Connect with text files a few times, and have been told it’s “by design”. I’m very glad to see it’s been addressed, after a fashion, in 2018.1.