CRLF in exported string variable

1
for ERP importing purposes we export a delimited string variable (build in microflow) to a file using the comm.commons StringToFile action. Looking at the generated file we see that new lines are separated by only a LF. The importing application needs new lines to be separated by CRLF. How can we achieve this?
asked
3 answers
1

A quick and dirty solution would be to change the StringToFile java action with something like:

StringUtils.stringToFile(getContext(), value.replace("\n","\r\n"), destination);

This would replace LF with CRLF. You could play around with replaceAll or replaceFirst depending on the desired results.

answered
0

see this

Edit: Dive into the java StringToFile action, change the code into something like this (not tested)

    StringUtils.stringToFile(getContext(), value.concat(System.getProperty("line.separator")), destination);
answered
0

You probebly need to change the java action of the community commons a little or ask for a feature request. Java will probebly pick your default line_feed char depending on the OS it is installed on. So if you want to export it using the CRLF you would need replace the "LINE_SEPARATOR_UNIX" char with the "LINE_SEPARATOR_WINDOWS" char. before you write it to an input stream.

answered