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: 

splitting an array with variables

Hi,

 

Although this is a fairly simple task, I am stuck with splitting an array.

 

Lets take an example

"group_device_project_PART1_voltage_current"

 

I have to get the voltage and the current out of the string. 

 

The problem is, the section PART1 keeps changing randomly. Is there a way I can split using PARTx where x is a variable?

 

 

0 Kudos
Message 1 of 2
(2,410 Views)

@Mr_Miagi wrote:

Hi,

 

... "group_device_project_PART1_voltage_current" ... 


If this is what the text always looks like, you can always take the 5th and 6th elements without worrying about the "x" in Partx:
Example_VI.png

 

If it's not that easy, you can use a Regular Expression to find the "Partx":

Example_VI.png

 

Match Pattern will work, too.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 2
(2,400 Views)