08-17-2017 10:46 AM
When using the Find and Replace function within the LabVIEW editor, is it possible to include a newline (line feed) character within the replacement string?
Solved! Go to Solution.
08-17-2017 10:59 AM
Have you tried it? Using a '\n'?
08-17-2017 11:41 AM
I can't think of any reason why not. Did you try it? Hint: make a test VI with just the Find And Replace function and the inputs you want and see what happens.
08-17-2017 12:10 PM
Yes, I did try that before I asked the question. The net result was that the two characters, "\" and "n" were inserted instead of a newline character.
08-17-2017 01:08 PM
Right-click the string constant and change to " '\' Codes Display " first, then put in "\n".
Note that this will change all of your spaces, tabs, etc in that string to \s, \t, and so on.
08-17-2017 02:29 PM
@Kyle97330 wrote:
Right-click the string constant and change to " '\' Codes Display " first, then put in "\n".
Note that this will change all of your spaces, tabs, etc in that string to \s, \t, and so on.
You do realize that this is the text entry box that's being discussed here?
What you suggest does not work.
08-17-2017 02:42 PM
I think what Kyle is saying is that once you turn on special codes display, the replace will work as you intend. The search function apparently only looks at what is visible in the control. If special codes is turned on, it will search and replace just fine. If they are turned off, it doesn't interpret '\n' as a newline and you will get unintended results.
08-17-2017 02:54 PM
It would be more trouble to go through the project and turn on (& later turn off) the special codes display in the 100+ places where I want to make the change than it would be to make the change manually after just doing a FIND.
08-17-2017 02:57 PM
Agreed but this is potentially do-able via scripting. Is this a one-time thing or something you forsee having to do frequently?
08-17-2017 03:02 PM
One time, I hope.
I just thought that there might be a simple way to do it that I was missing.
It really sounds like there is not.
I can do it manually in less time than it would take to create a script and get it working right.