LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie conversion question!

Need help converting a string of the following format; "0 -84 0 1 2455" into
an array.
Is there a straightforward way of doing this?

Best Regards,

Mike
0 Kudos
Message 1 of 4
(2,976 Views)
On 9 May 2000 09:03:25 -0500, "Mike"
wrote:
>Need help converting a string of the following format; "0 -84 0 1 2455" into
>an array.
>Is there a straightforward way of doing this?

In the string palette find the function
Spreadsheet String To Array
wire
- a string constant with a space to input 'delimiter'
- a string constant with "%d" (or "&f") to input 'format string'
- an empty array of the same data type as you want to input
'array type'
- your data string to input 'spreadsheet string'


--
Rolf
0 Kudos
Message 2 of 4
(2,976 Views)
Mike,

there may be an easier way, but one solution is to use the 'search string'
function to search for blanks. the function returns the string before
and after the blank. you can wire the before portion to a build array function
and the after portion to another 'search string' function. do this for each
blank and connect each before string to the build array function. hope this
helps

pat


"Mike" wrote:
>>Need help converting a string of the following format; "0 -84 0 1 2455"
into>an array.>Is there a straightforward way of doing this?>>Best Regards,>>Mike
0 Kudos
Message 3 of 4
(2,976 Views)
"Mike" wrote:
>>Need help converting a string of the following format; "0 -84 0 1 2455"
into>an array.>Is there a straightforward way of doing this?>>Best Regards,>>Mike

If you want every character as a byte in an array use the string to array
function found in the string palette

if you need the separate numbers in an array of integers look in the examples
for strings

I forgot the name of the example but it converts numbers from a string into
an array of numbers. something like extract numbers.vi
greetings from the Netherlands
Message 4 of 4
(2,976 Views)