LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete empty strings from array

Solved!
Go to solution

Yet another solution if you don't want to use OpenG:

delete-empty-strings.png

Message 11 of 20
(4,430 Views)

thanks dan_u and _lan_ for your help any your solutions Smiley Happy

0 Kudos
Message 12 of 20
(4,426 Views)

Nice solutions, but is there any similar, simple methods for a 2D array?:)

 

Greetings

Kristoffer

0 Kudos
Message 13 of 20
(4,359 Views)

Sjefsgjogleren,

I would suggest you try to adapt that piece of code yourself. A second while loop would assist with the second dimension. However, it likely would need a few more small adjustments. Feel free to post your progress here and people will be more likely to assist.

Ben D.
Applications Engineer
National Instruments
0 Kudos
Message 14 of 20
(4,325 Views)
0 Kudos
Message 15 of 20
(4,318 Views)

This vi delete the empty rows from array 2D

 delete empty rows.PNG

0 Kudos
Message 16 of 20
(2,669 Views)

@Lunal wrote:

This vi delete the empty rows from array 2D

 


This thread is 6 years old and solved. No need to attach an extremely inefficient solution that is also wrong. (For example it would output incorrect result if some rows contain empty and non-empty strings).

 

  • Why would you operate on columns (you transpose at the beginning and end) if the task is about rows?
  • Why would you need to measure the array size with every iteration of the outer loop? Wouldn't once be enough? The size does not change between iterations here (well, the compiler will probably optimizes this, but still ...)
  • "delete from array" typically does not belong inside a tight loop.
  • The inner loop iterates way too many times (# of empty strings << # of array elements).
  • ....
0 Kudos
Message 17 of 20
(2,660 Views)

Hello,

 

I've used your suggestion but...each time the vi run the Array is not erased and it's populated keeping previous results.

 

First run

 

brambo60_0-1664365162818.png

Second run

brambo60_1-1664365239743.png

Where is the mistake?

 

Thanks in advance

 

I add my vi.

 

0 Kudos
Message 18 of 20
(1,263 Views)

Sorry,

 

I;ve solved the case.

 

Thanks to your multiple examples.

0 Kudos
Message 19 of 20
(1,256 Views)

 


@brambo60  ha scritto:

I've used your suggestion

 


What suggestion? My suggestion is to use the "Quote" button from the toolbar to indicate what's the post you are referring.
I cannot open your vi, but I guess you are not initializing a shift register. An uninitialized sr retains its previous value, so running multiple times may end in concatenating the results.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 20 of 20
(1,255 Views)