All I want to do is break my 1d numeric array into seperate numbers so they can be represented as single number numeric indicators. If I use the delete from array function the number is still represented in an array.
Very easy answer I am sure but little things like this drive us crazy.
The example is pretty efficient, and has the advantage of being fairly flexible if you have an odd format to your string.
Other ways to do it:
1. If you have a known format (e.g. always 7 numbers separated by
commas), you could use the Scan From String function. This would
avoid the need to loop on the string.
2. You could do something similar to the example, but use the
Search/Split String function instead of the Pattern Match
function. This would let you pull out the commas as you travel
down the string, and grab the numbers that occur before them.
This is less flexible than the example, but it might be a shade faster.
I'm sure others here have some unwholesomely clever ways of doing this as well.
Joe Z.
I'm not sure which method the example vi uses, but scanning strings is very slow. You'll only notice this with very large data sets though.
If you want it to be efficient (and if it's possible), use Spreadsheet String To Array. I've seen speed improvements of 1000 times.
Regards,
Wiebe.
"Ashley.w" <x@no.email> wrote in message news:1151055608195-382668@exchange.ni.com...
Thank you!
I then have another question.
I am using the extract numbers example vi to get the numerical data back from my comma seperated data string
I.e. sting data: 1,2,3,4,5,6,7 etc.. gives me a numeric array 1,2,3,4,5,6,7 etc.
is this an efficeint way of doing this?
Many thanks
Ash