LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on filtering an element with a Regular Expression

Hi everyone,

 

I am working on a regular expression module.

 

I have the input as '+0.00000000E+000,+0.00000000E+000,+1.60000000E+001,-5.28637600E+000,-5.28637600E+000,+0.00000000E+000' and need to seperate them into 6 elements and put it to an array.  

 

I already succeed to do this, the second step is how to filter, say, I don't need the 2rd (index needs to be an input from user) element in the array but others.

 

 

I am attaching the one I finished, with a lot helps from you guys before.

 

I am not sure the thing I need do could be handled by regular expression by something like 'NOT 2rd elmenet' syntax.

 

I know I could use something like 'if iteration = 2, then don't output', but I really like to make it all rely on regular expression.

 

Any idea is well appreciated,

 

 

Thanks,

 

+Kunsheng

 

 

Message Edited by Kunsheng Chen on 03-11-2009 01:29 PM
0 Kudos
Message 1 of 3
(2,388 Views)

Hi Kunsheng,

you can use the "Spreadsheet String to Array" function. If you have the array, then you can use the index array function to get the elements you need.

 

Mike

0 Kudos
Message 2 of 3
(2,381 Views)

Good Morning Kunsheng,

 

Since you already have these numbers in separate elements within an array, I would use the Delete From Array VI in the String Palette.  This VI allows the user to select which element is removed.  If, instead, you wish to replace a given element rather than decreasing the size of the array, try the Replace Array Subset VI (also in the String Palette).

0 Kudos
Message 3 of 3
(2,342 Views)