LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert comma-separated-string into numeric-array?

Solved!
Go to solution

Hello,

my 34401 returns 200 values in a string with this format:

-1.42979706E-03,+4.46900451E-03,-8.48235088E-04,-2.17539596E-03,-1.34144462E-03,+4.50590958E-03,-9.78340028E-04,-2.31519575E-03,-1.10844497E-03,+4.70200416E-03,-9.83187455E-04,-2.45499555E-03.....

 

So the numbers are comma-separated and the doubles have a point.

 

How can i now move this values into a double-array?

 

Thanks for the help

0 Kudos
Message 1 of 12
(21,929 Views)

Hi OnlyOne,

 

easy like this:

20223i6E806FBE09F9FDFD

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 12
(21,919 Views)

Thx for the fast answer but its not working corectly.

 

The numbers are wrong converted:

 

For example a:

+2.93120677E-03 is converted to 2 instead of 0,00293120677

 

Whats wrong here?

 

0 Kudos
Message 3 of 12
(21,903 Views)
Solution
Accepted by OnlyOne

Hi OnlyOne,

 

you should note that you configured your computer wrongly Smiley Wink You use German/East Europe regional settings with "," as decimal separator and try to convert measurement data using "." instead...

 

Well, try a format string of "%.;%f" - and read the help for format strings!

 

When the different format string also fails, you may try this one:

20225iC85653BA6FBF7EF9

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12
(21,900 Views)

Thx for the solution. Both things are working.

 

0 Kudos
Message 5 of 12
(21,883 Views)

Hello, 

 

I was working on similar project.  I got to separate two string number as (25 , 124) where first number is temp and second is pressure read from arduino device.  I need to separaye these two numbers and put it into graph as well as store the results in a file.  

My readings are as:

24,124

25,167

33,234

and so on...

i could separate using your vi but it puts both in array  .  I was trying to separate it out and put in graph .

 

I look forward for anyone's help.  If I could get he Vi or detail information on it, I would really appreciate it.  

0 Kudos
Message 6 of 12
(20,746 Views)

Use Index Array to get two different 1-D arrays of each column.

0 Kudos
Message 7 of 12
(20,742 Views)
Thank you for the reply. To be honest i am new to this labview . If you could show any example Vi i would really be so thankful.
0 Kudos
Message 8 of 12
(20,738 Views)

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 9 of 12
(20,732 Views)

Thank you for this post. I had the reverse problem, converting a numeric array to comma separated list of strings.

0 Kudos
Message 10 of 12
(19,828 Views)