02-21-2012 01:03 PM
I'm trying to scan one long string and the length may vary. I'm trying to display each character. for example.
Example.
,,,,,,,,,,,,,,,,,*1E if they are 2 commas back to back then stop the scan.
04,05,08,10,11,,*1E In this case i would like to first scan the string from left to right and display the numbers before the comma as long as there isn't 2 commas back to back
04,05,08,,,,,,,,,*E In this case I would like to scan the string from left to right and display the numbers before the comma 04 and 05 and 08 and stop there are 2 commas back to back.
Solved! Go to Solution.
02-21-2012 01:10 PM
Depending upon what you are going to be doing with the data next, use the spreadsheet string to array function to turn the string into an array of strings and then search the resulting array for the first element containing a null string. Then pass everything before the null element to the function for turning a numeric string into a number and (hey, presto) you have an array of numbers.
Mike...
02-21-2012 01:16 PM
Or, just use split string.vi from deep in the bowels of vi.llb
Exit a auto indexed loop on null string and rip off the last element if it was null
02-21-2012 01:28 PM
It is a string that constantly updates.i was able to use the spreadsheet string to array function, but not sure how to search the resulting string for the first element containing a null string sorry please explain.
02-21-2012 01:29 PM
Thanks for the pic example!
02-21-2012 01:51 PM
can you post your split string.vi in labview 2009 please because i can't find it online?
02-21-2012 02:07 PM
Its is ...\LabVIEW\vi.llb\AdvancedString\Split String.vi. it is not on the palattes because its an undocumented function.
02-21-2012 02:12 PM
Thanks!
02-21-2012 02:25 PM
I still wasnt not able to get it to do exactly what i need for it to do.
02-21-2012 05:25 PM
@*E* wrote:
I still wasnt not able to get it to do exactly what i need for it to do.
Need a better post there E. Thats like asking " Hey, I need directions to the nearest bathroom". Not much we can help with if we don't know where you are.
Show us what you have (Post the vi you are working on)
Post what it does wrong (what input (s) give you "Bad outputs)
post what you want it to output