Hi all,
I have a multiple lines of text field in SharePoint and I need to parse the contents so that
Line 1 text
Line 2 text
Line 3 text
becomes Line 1 text\nLine 2 text\nLine 3 text. The \n is an actual text replacement in place of whatever equates to the carriage return and I know that I would need to escape it as \\n.
I have tried using regular expressions to do the replacement but have had no success with patterns such as \n\r, \f etc.
The \s replaces all spaces so I end up with Line\n1\ntext\nLine\n2\ntext etc. which is not what I want. $ puts the replacement text at the end of Line 3 text only which makes me think it can't distinguish one line from the other but it is displaying it as such so I must have the wrong syntax. I tried unicode values for carriage return, line feed etc. that I found but that didn't seem to work either. I have tried using rich text format on the column as well and tried the html code on the list item itself which had \n\u003cbr\u003e between the different lines.
I wonder if build a string would work but I'd still need to find the end of a paragraph.
I'm not sure if I can achieve what I'm trying this manner or not so if anyone has any pointers or different suggestions, I'd appreciate it.