LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract value between square brackets from a string

Good morning. I would need to take the individual float values, inserted between the square brackets and save them in arrays or even in separate indicators for each value. I tried a scan from string, but I can't figure out how to make it work properly. Attached is a VI, run with Labview2016, where a series of values are listed in square brackets. Could you give me some help. Thank you Francis

0 Kudos
Message 1 of 7
(889 Views)

Here is my take on the solution,

 

[Edit] Even simpler

santo_13_0-1703704231686.png

santo_13_1-1703704241901.png

 

 

 

VI attached in v16.0

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 7
(843 Views)

Thanks for your help. In reality the values contained in the square brackets have the decimal point, not the decimal point. This example works if we have, for example, 5.456 and not 5.456

0 Kudos
Message 3 of 7
(810 Views)

I have fix it in attachment.

0 Kudos
Message 4 of 7
(805 Views)

@ciccio25 wrote:

I have fix it in attachment.


You have to explicitly call out the decimal separator in the format string only if system default in different from the separator used in your string. Depending on the source of this string and the computer this code runs on, it should be handled.

 

Are you sure that the string will always use dot as decimal separator?

 

santo_13_0-1703714669150.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 7
(790 Views)

HI.

 

Yes i'm sure, the system will use only decimal poit.

I use Labview on Debian 10 distribution.

 

More Thanks for support.

0 Kudos
Message 6 of 7
(739 Views)

If your question was answered, please mark appropriate post as answer.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 7 of 7
(675 Views)