08-07-2018 07:09 AM
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!
Solved! Go to Solution.
08-07-2018 07:22 AM
No idea. You didn't provide any VI so we can see how you wired things up and figure out what is wrong.
08-07-2018 07:28 AM - edited 08-07-2018 07:29 AM
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).
08-07-2018 07:34 AM
Need to see code, preferably with and example string so we can analyze it.
08-07-2018 07:46 AM
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!
08-07-2018 07:50 AM
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
08-07-2018 08:06 AM
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
08-07-2018 08:26 AM - edited 08-07-2018 08:29 AM
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.
08-07-2018 08:44 AM
@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).
08-07-2018 08:49 AM
@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.![]()