Hi Team,
I have a multi text process variable with multiple string values, when i write the content to a text file using "Text Doc from Template" smart services, while passing the content to template i have used substitute method to replace ";" string with a line break char(10) to create a line break, but it is not reflecting in the file which i have created, where as in expression rule the line breaks are working perfectly. Please help me to resolve this issue.
Discussion posts and replies are publicly visible
What text editor are you trying to view the generated file in?
Basically the file is sent to Linux server, and there am viewing it using Vi editor.
Some text editors (particularly more primitive ones like vanilla windows Notepad and, possibly, VI) require char(10) and char(13) at the end of every line instead of just char(10). I'd suggest you try ending each line in "char(13) & char(10)", and see what happens.
Hi Mike, Still no Luck just typed the code below
Note: pv!fileContent (Multi Text)
substitute(concat(pv!fileContent),";", char(13) & char(10) ) --AM finding and replacing the ; symbol with the new line
Then this is written to the text file template
if pv!fileContent is an array, then calling concat() on it will not result in ";" characters to find and replace; when viewing the value of an array elsewhere the ";" character is only added on the rendering side to help human readers, but is not actually contained in the array. For instance, concat({"a", "b", "c"}) will output abc instead of a; b; c.
Try this instead: joinArray(pv!fileContent, char(13)&char(10))
Also, if it still doesn't render in VI as you might expect, can you try to open the resulting file in a modern/good text editor (i.e. notepad++, etc) and report what you find there?
Note: if this works, then you may not have needed the char(13) at all, the issue may have just been the concat. So you could go back and try it again without the char(13) if the above works.
Thanks Mike, joinArray helps :) and i have fixed it now !