Sidebar

How do I ensure that my text-based output file has both Carriage Return and Line Feed (CR/LF) at the end of each line?

0 votes
526 views
asked Jun 18, 2014 by matt-w-2627 (3,220 points)
My channel creates a text-based output file which has only Line-Feeds at the end of each line. the receiving system needs both Carriage-Returns as well as Line-Feeds. Is there a way to force this behavior?

1 Answer

0 votes
 
Best answer
By default qie.createTextMessage will generate an output with LF (0A) at the end of each line.

to modify this, use message.setNode as well as StringUtils.replace the line encoding:

    message.setNode('/', StringUtils.replace(message, '\n', '\r\n'));

the above code will replace LF (0A) with CRLF (0D0A)
answered Jun 18, 2014 by matt-w-2627 (3,220 points)
...