LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change the format of a string

Solved!
Go to solution

Hello all,

 

Now what shall I do is to convert a string to an array.

 

The string I got is shown in the pic in attachment, together with my code.

 

Obviously the array isn't correct.

 

i wonder if there's a way to change the format of the string without the empty lines, and concatenate each number after another,

 

in order to have a correct array with my code.

 

Or someone has idea to make a new code for converting a string like this to array?

 

Thanks

 

Chao

 

 

0 Kudos
Message 1 of 6
(2,714 Views)

Hi Chao,

 

1. Use SpreadsheetStringToArray with a comma (or NewLine) as separator...

 

2. Attach your VI instead of a picture. So we would have the option to edit the VI...

Best regards,
GerdW


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

Spreadsheet String to Array

 

<edit> Race condition.  I lost to GerdW.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 6
(2,705 Views)

Hi Gerd!

 

Here is my VI. Actually I figured out a simple way to implement this, just by

 

adding a Trimwhitespace.vi between the input string and match pattern, and that works!

 

I'm still glad to know how do you use spreadsheetstringtoarray.

 

Thanks in advance if you can show me that!

 

Chao

0 Kudos
Message 4 of 6
(2,671 Views)
Solution
Accepted by jcraffael

I think they are referencing something like this.

 

0 Kudos
Message 5 of 6
(2,658 Views)

Wonderful! That's it.

 

Thanks a lot for the reply!

 

Chao

0 Kudos
Message 6 of 6
(2,651 Views)