LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to double array

Solved!
Go to solution

hello!! 

 

I have a string data which is arranged as a matrix 4X10. 

I want to make it to an 2D array(of double) I tried to use spreadsheet sprint to array but it only gives me the first column.

how to solve please??

 

thanks for helping!

 

0 Kudos
Message 1 of 11
(6,674 Views)

No idea.  You didn't provide any VI so we can see how you wired things up and figure out what is wrong.

0 Kudos
Message 2 of 11
(6,661 Views)

Hi.

Could you show us what your 'string data' is looking ? Because if i create a string data like you described, the function just works perfectly fine (see snippet).

 

0 Kudos
Message 3 of 11
(6,656 Views)

Need to see code, preferably with and example string so we can analyze it.



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 4 of 11
(6,650 Views)

As you see in the example is what I managed to import into labview.

i use Matlab to get some data and then uploaded it to the cRIO. that string could be an array of 8X10000, in some cases, this is just a test

i only need to read the data to array once.

thanks for helping!

 

0 Kudos
Message 5 of 11
(6,643 Views)

You are kidding us, right?  You are asking for help, you have a data file (which may have hidden characters like <Tab>, <Carriage Return>, <Line Feed>, and others), but only show us a picture of the file.  Are you expecting us to waste our time typing in the characters that you show us (and "guessing" whether the space is a <Space> or a non-printing character) when you could have attached the actual Text File?  Same thing with the picture of your code, which is difficult to edit, to run, to modify.

 

Please, attach your data file and also attach your VI.

 

Bob Schor

Message 6 of 11
(6,639 Views)

sorry,

as i said i am using cRIO(9076) trying to get data from it(which i added before) to use in Real-Time.

first time using this..

if you need anything else let me know.

thanks for helping

Download All
0 Kudos
Message 7 of 11
(6,632 Views)
Solution
Accepted by topic author EyalZ

Thanks.  These files are what should have been attached in message #1.

 

Now we can see the problem.  In your VI, your constant that tells the String to Array function what delimiter to use is in Normal display mode.  So that \t  is a literal backslash and "t", and also a space.  That is not a tab character.  You need to change it to \codes display, then retype "\t"  (without the quotes) and that will indicate a tab.

 

Also, open up context help and check how you have ti wired.  You have the data string and format string swapped.

 

main

Message 8 of 11
(6,622 Views)

@RavensFan wrote:

Now we can see the problem.  In your VI, your constant that tells the String to Array function what delimiter to use is in Normal display mode.  So that \t  is a literal backslash and "t", and also a space.  That is not a tab character.  You need to change it to \codes display, then retype "\t"  (without the quotes) and that will indicate a tab.

 


Or just not even wire up that input (defaults to a tab).



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 9 of 11
(6,608 Views)

@crossrulz wrote:

@RavensFan wrote:

Now we can see the problem.  In your VI, your constant that tells the String to Array function what delimiter to use is in Normal display mode.  So that \t  is a literal backslash and "t", and also a space.  That is not a tab character.  You need to change it to \codes display, then retype "\t"  (without the quotes) and that will indicate a tab.

 


Or just not even wire up that input (defaults to a tab).


True.  But I figured the lesson in display style was worthwhile here.Smiley Happy

0 Kudos
Message 10 of 11
(6,604 Views)