LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn a string of two columns intoa numeric array?

I want to turn a string consisting of two columns of numbers to a 2D array so that I can graph the data on an XY graph. How would I do this?

 

For example, if the string is 

 

1 5

2 4

3 7

4 9

 

How would I convert this string to a numeric 2D array?

0 Kudos
Message 1 of 15
(2,776 Views)

Try "Spreadsheet string to array" and set your delimiter to "Space".

0 Kudos
Message 2 of 15
(2,754 Views)

By doing this, my array only returns the first column. I need both values in the first row. There's likely something small I'm missing. 

0 Kudos
Message 3 of 15
(2,749 Views)

aaa1.pngaaa2.png

0 Kudos
Message 4 of 15
(2,744 Views)

@zackmurphy wrote:

There's likely something small I'm missing. 


Of course there is, but if you don't show us your code and actual string, we cannot help.

 

  • Is the type a 2D integer array?
  • Is the delimiter really space or something else (tab, nonprintable, etc.)
  • etc.
  •  
0 Kudos
Message 5 of 15
(2,742 Views)

No pictures, the actual VI please! We cannot debug pictures!

 

Also please resize your array containers to show more than one element.

 

(You delimited looks more like an empty string instead of a space character. LabVIEW will assume tab in that case.)

0 Kudos
Message 6 of 15
(2,738 Views)

@zackmurphy wrote:

By doing this, my array only returns the first column. I need both values in the first row. There's likely something small I'm missing. 


Is your delimiter (the character between values) actually a space?  Or is it a tab?  Are you sure you even have a space in your delimiter constant?  There is a Space Constant to make it more clear.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 15
(2,734 Views)

My apologies. Here are photos of my front panel and block diagram. 

Download All
0 Kudos
Message 8 of 15
(2,733 Views)

Make sure you're expanding the array indicator both vertically AND horizontally.

 

And post your code, not just pictures (Select All, Edit: Create Snipped from Selection).

0 Kudos
Message 9 of 15
(2,731 Views)

Here's the snippet. 

0 Kudos
Message 10 of 15
(2,728 Views)