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: 

Searching a string for multiple specific strings

Solved!
Go to solution

Hello,

How in LabVIEW can one search a string for multiple strings. Say I have the string "Hello, what time is it?". How would I search for the strings "is" and "what"?

0 Kudos
Message 1 of 6
(4,133 Views)

There are, in short, a TON of ways to do that with LabVIEW. This is quite possibly the simplest way, though it does not deal with the possibility of multiple matches of the same word: 

FireFist-Redhawk_0-1595357360160.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 2 of 6
(4,117 Views)

Okay, I'm looking for a more specific way. 

I am trying to look for the strings "T1","T2,"T3","T4"...etc in a file path converted to a string such as "<C:\Users\OneDrive - Mil\Documents\PBR\Ortho Wrecker 6in photos\Blade 2 (Scored)\Ortho4120_B1232_G4_C0_T18(2).jpg>". If any of the strings are found, then a boolean TRUE will be output.

0 Kudos
Message 3 of 6
(4,107 Views)
Solution
Accepted by StevenZi

Not a lot of modification to it then...

FireFist-Redhawk_0-1595358887125.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 4 of 6
(4,092 Views)

You can use the above example that was provided and

  • Convert the File Path to a String
  • Put a conditional terminal on the For Loop.
0 Kudos
Message 5 of 6
(4,091 Views)
Solution
Accepted by StevenZi

Alternative below

using regular expressions.

StringMatch.png

Message 6 of 6
(4,072 Views)