LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace whole line of string

Solved!
Go to solution

This seems like it should be trivial but its killing me rn. When I search a multi line string for lines starting with <something> how do I replace all of the text in that line of string with new text, not just the first word? The text in the lines(s) of the incoming string is not always the same length. Sometimes the number in the line is larger, also I'm not sure of how much white space there will be. 

 

I see what's happening and why I'm getting:

apples 15 pass 26 fail
oranges 13 pass
grapes 12 pass

 

What I would like to end up with is:

apples 15 pass

oranges 13 pass
grapes 12 pass

TheWolfmansBrother_0-1615904592312.png

 

0 Kudos
Message 1 of 3
(1,003 Views)

Hi Brother,

 


@TheWolfmansBrother wrote:

When I search a multi line string for lines starting with <something> how do I replace all of the text in that line of string with new text, not just the first word?


Convert your input string into an array of "line" (using SpreadsheetStringToArray).

Then autoiterate that array and replace the whole line when you detect your "starting word"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(987 Views)
Solution
Accepted by topic author TheWolfmansBrother

^apples.*$

Message 3 of 3
(969 Views)