bildwelt
E2E FORUM
E2E Bridge E2E Commerce

How to replace carriage return characters with line feeds

E2E Forum Modeling & Development How to replace carriage return characters with line feeds

This topic contains 0 replies, has 1 voice, and was last updated by  Andi 3 years ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1786

    Andi
    Moderator

    Recently we got this question via E2E support:

    To cope with a ‘weird’ file from a customer I need to replace carriage return characters (x’OD’) with line feeds (x’0A’).
    I tried this:
    set transcodedString = transcodedString.replace("\r", "\n");
    but all that does is take the n as a literal so I end up with lots of n characters instead of line feeds.
    What syntax should I use?

    The answer is, you have to use the text() macro for the replacement, see also at http://docu.e2ebridge.com/text# and http://docu.e2ebridge.com/replace#

    set transcodedString = transcodedString.replace("\r", text("\n"));

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.