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: 

Checking for a sequence in string

Solved!
Go to solution

Hi all

 

I have a string input which consists of numbers. 5 numbers seperated by semmicolon represents one set. The numbers could be 2 digit,3 digit or 4 digit.


 And there could be 1,2 ,3 or 4 sets . How can i check whether any of the set in the input contains a 0; 0; 0; 0; 0.000; ??

 

I tried using Match First string and Match True /False String. But Match True/False string examines only the beginning of string.

 

Can anyone suggest some ideas hw to proceed? 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 1 of 3
(2,255 Views)
Solution
Accepted by topic author Nghtcrwlr

Hi Nightcrwlr,

 

why don't you use SpreadsheetStringToArray and just check the number of elements in the array to separate your "sets"?

check.png

After separating the sets (ArraySubset) you could just compare each set for zero...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,247 Views)

Hi GerdW

 

That was a gud suggestion. :D. Thanks a lot

 

At the moment i do have only inputs with maximum 4 sets. So i made  4 different cases  to check each set.

i.e  Case 1 have 1 check , Case 2 have 2 checks and so on.

Anyways found a solution. Thanks

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 3
(2,227 Views)