LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to split the string????

Solved!
Go to solution

Hello,

 

I am getting data like ~^1820|-93.13|+4.57|-3.20|183.62'

that all value assigned something like height, angle etc..

I want to split this string could anyone please help me How to do that.

I want in one like.  1820

                              a= -93.13

                              b=+4.57

                              c= -3.20

                              d=183.62

Thank you very much in advance.

With greetings,

Ankit.

 

0 Kudos
Message 1 of 19
(2,885 Views)

Hi

 

Try using "Spreadsheet String To Array"  as mentioned in below image

 

Untitled.png

Regards,

Murali

*Kudos welcome*

Message 2 of 19
(2,878 Views)
Solution
Accepted by topic author AnkitRamani

Hi Ankit,

 

use SpreadsheetStringToArray:

Beispiel_VI.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 19
(2,875 Views)

Thank you very much for your suggestion.

 

0 Kudos
Message 4 of 19
(2,863 Views)

Hi Ankit,

 

my example shows the single elements of the array! What else do you need?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 19
(2,854 Views)

Thank you very much for your suggestions.

 

i am not gettign the first value in that case which is suggested by GerdW.

first value is after ~^ this sign.

 

Greetigns,

Ankit.

0 Kudos
Message 6 of 19
(2,847 Views)

Hi Ankit,

 

you should not edit message when other people have posted an answer to your (pre-edit) message…

 

You need to "clean up" your string by removing those two extra chars at the beginning or you may start to use RegEx functions and expressions. (I'm not an expert in RegEx, so other may chime in…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19
(2,841 Views)

Thank you very much for your reply.

 

But in my case it is not possible to remove that signs. 

because it is by default form the instrument.

 

Thank you very much once agian.

Greetings,

Ankit.

0 Kudos
Message 8 of 19
(2,833 Views)

Hi Ankit,

 

Beispiel_VI.png

What exactly was your problem? 😉

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 19
(2,828 Views)

It's less scalable (so I don't exactly recommend this), but you could also use Scan  From String.

 

Again, I recommend Gerd's solution of using the Spreadsheet String To Array after using the Substring to remove the first two characters.


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
Message 10 of 19
(2,818 Views)