Skip to main content
Nintex Community Menu Bar
Question

Replace Unix line breaks (\n) with DOS (Windows) line breaks (\r\n) using Nintex


Forum|alt.badge.img+3

I am migrating a workflow from Nintex for SharePoint 2013 to NAC.  One for the requirements is that I be able to replace the Unix line break character (\n) with DOS line breaks (\r\n) in the text before creating the .csv file.  In SharePoint 2013 I was able to do this using a regular expression action which replaced “\n” with the function “Common:Newline” which replaced them with DOS carriage return.  This function is not available in NAC and when I try to use the NAC regular expression replace action, it is able to find the Unix carriage returns with the pattern “\n” but it replaces them with the actual text “\r\n” instead of the special character.  I have seen several solutions about using variables as the replacement for spaces but nothing on creating a variable for a special character like a DOS carriage return.  Has anyone had to do something like this that can offer a workaround? 

Translate
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+10
  • Scout
  • 129 replies
  • January 11, 2024

Yeah, I don’t like the decisions NAC makes when it comes to these kinds of characters.  I had a similar problem here, but I don’t think that’ll help in your situation: 

 

Whenever I try to get a variable to contain a “\r\n” combination, NAC always converts it to <br> for some reason… That probably accomplishes what’s necessary for an email, but certainly not for your CSV. 

Translate

Forum|alt.badge.img+3
  • Author
  • Rookie
  • 23 replies
  • January 11, 2024

At this point I have a work around in place for the system that I was sending the file to where I have to create individual files to send each request.  And luckily the Unix line breaks don’t appear to be an issue for the other systems that I am creating CSV files for like this.  Just disconcerting that the replacement field in the regex action is interpreted as literal text instead of allowing character patterns.  

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings