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?
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) )
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.
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’?
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.