From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search and Replace String Function replaces line feeds when I only want spaces replaced?

Solved!
Go to solution

I need to replace every instance of a space or series of spaces in a multi line string with commas (or tabs) so I can dump it into a spreadsheet.

 

I am using the regular expresion [\s]+ and it works but it is also replacing the end of lines (\r\n) too.

 

How can I make it replace the spaces but leave teh end of lines intact?

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 3
(2,319 Views)
Solution
Accepted by topic author RTSLVU
Right click on the search string and change it to '\' Code Display. Enter the space character (\s) correctly - you've got \\s right now.
Message 2 of 3
(2,311 Views)
Thank you, it's always something simple I am over looking.
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 3
(2,302 Views)