ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remove line feed from a string

Solved!
Go to solution

In the attached VI, I expected my output to be one long string, but instead it is a string with what looks like to be line feeds inserted. That is my output looks like:

 

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

 

and what I want is:

 

    xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

 

Is there an easy way to eliminate the linefeeds?

 

Thank you

0 Kudos
Message 1 of 6
(21,062 Views)
Solution
Accepted by chuck72352

Just do a "Search and Replace String" with LF as search string, empty string (or probably a space if needed) as replace string, and replace all instances set to true.

 

Hope this helps

 

Message 2 of 6
(21,058 Views)

A picture is worth thousand words.

 

Remove CRLF.jpg

Message 3 of 6
(21,054 Views)

So then is a snippet worth a thousand thousand words?

 

string replace.png

Stephen Meserve
National Instruments
Message 4 of 6
(21,024 Views)

So I ran into this exact issue yesterday where using a \n or a LF constant didnt work- saved a vi as an example to post up with, then I found this thread and saw that you have to use the EOL constant- the sad part is I apparently kudo'd one of these answers back in october Smiley Tongue

0 Kudos
Message 5 of 6
(20,484 Views)
I right click and change S&R to Regular Expression mode then I choose \v as the search string. This removes all forms of vertical whitespace, be it CR, LF or any combo thereof.
Message 6 of 6
(20,479 Views)