03-11-2009 01:25 PM - edited 03-11-2009 01:29 PM
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
03-11-2009 01:34 PM
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
03-12-2009 10:14 AM
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).