LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan string

Solved!
Go to solution

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.

0 Kudos
Message 1 of 30
(3,692 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 30
(3,688 Views)

Or,  just use split string.vi from deep in the bowels of vi.llb

Fun.png

 

Exit a auto indexed loop on null string and rip off the last element if it was null


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 30
(3,685 Views)

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.

0 Kudos
Message 4 of 30
(3,681 Views)

Thanks for the pic example!

0 Kudos
Message 5 of 30
(3,680 Views)

can you post your split string.vi in labview 2009 please because i can't find it online?

0 Kudos
Message 6 of 30
(3,666 Views)

Its is ...\LabVIEW\vi.llb\AdvancedString\Split String.vi.  it is not on the palattes because its an undocumented function. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 30
(3,661 Views)

Thanks!

0 Kudos
Message 8 of 30
(3,655 Views)

I still wasnt not able to get it to do exactly what i need for it to do.

0 Kudos
Message 9 of 30
(3,648 Views)

@*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


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 30
(3,634 Views)