Jump to content

Did you know you could do that? RE: Spreadsheet String to Array


Recommended Posts

On 7/7/2022 at 12:06 PM, sam said:

I've been surprised today with one of the LabVIEW's most useful functions (imo) which I use all the time.  After so many years and only now seeing this behavior/feature.  I thought I share it 🙂

I've always used an empty array of N-Dim for my desired type input.  only to accidently find out today that I can also use a scalar for the type.    ha!
image.png.b50101d2dfb3b3e766998c05d4822e79.png

 

But if you provide a string that should be interpreted as a 1D array, and chose "create indicator", the created indicator is a 2D array:

image.png.f250b63e4c405cac0e331eb8196c4aca.png

Try to force the output to be 1D by connecting a 1D array indicator, and you get a broken wire:

image.png.bd13df5d0937ab6084c4efb6c89520c9.png

In other words, it seems that if you want a non 2D output, you need to specify the type.

image.png.22f82a637e4155919169f24508cf1dc1.png

BTW, in the first diagram above, the 2D array output contains a single row, so the string is properly decoded (ignore the missing format string).

Bonus: did you know that if you set the expected type to be 1D (and obviously the output to be 1D), a "2D" string will be cast to 1D?

image.png.ce80ae2a097ae469b80330927974fd09.png

 

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.