取消
显示结果 
搜索替代 
您的意思是: 

change the format of a string

已解决!
转到解答

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 项奖励
1 条消息(共 6 条)
3,410 次查看

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 项奖励
2 条消息(共 6 条)
3,405 次查看

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 项奖励
3 条消息(共 6 条)
3,401 次查看

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 项奖励
4 条消息(共 6 条)
3,367 次查看
解答
已被主题作者 jcraffael 接受

I think they are referencing something like this.

 

0 项奖励
5 条消息(共 6 条)
3,354 次查看

Wonderful! That's it.

 

Thanks a lot for the reply!

 

Chao

0 项奖励
6 条消息(共 6 条)
3,347 次查看