LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove repeated row in 2D array

Hi,

 

How can I remove the row for second repeated data in my 2D array regardless of the 2D array size.

 

111.PNG

0 Kudos
Message 1 of 12
(4,948 Views)
  • In your example, the data is not repeated because the rows differ in the third column. you need to be more specific.
  • Are (pseudo-) duplicate rows always adjacent as in your example?
  • What is the datatype of the array? (string, numeric?)
  • Is the pattern very regular? (i.e. would it be sufficient to simply remove e.g. the rowns with an odd index?)
  • If the answer  to the above question is NO, please show a more typical pattern.
0 Kudos
Message 2 of 12
(4,942 Views)

Hi Altenbach,

 

As long as the first 2 column repeats, I will delete the second repeated row. The datatype is double. The repeated data is different at every run.

1121.png

0 Kudos
Message 3 of 12
(4,929 Views)

Use a shift register in a FOR loop to keep track of the n-1 row data.

0 Kudos
Message 4 of 12
(4,923 Views)

With a few simple strikes of the mouse, you could probably adapt this example (i.e. change the array of strings to an array of DBL and select key column #0). Let me know if you have problems.

 

 

(Do we really need to look at the second column, FOr you data it seems that looking at the first column might be sufficient.)

0 Kudos
Message 5 of 12
(4,912 Views)

Yes, I need to look at the second column this is just a portion of the array.

0 Kudos
Message 6 of 12
(4,908 Views)

Can you attach a simple VI that contains the array of post #3 as a diagram constant?

 

The basic algorithm remians the same, but instead of a single column you would take the array subset of the first two columns, autoindex it the same, and compare the array of two elements with the previous (compare aggregates).

0 Kudos
Message 7 of 12
(4,900 Views)

Is it okay for me to post snippets? This is my first time creating a snippets.

 

array.png

0 Kudos
Message 8 of 12
(4,896 Views)

Try this...

 

 

 

There are many variations possible. 😄

Message 9 of 12
(4,884 Views)

1111png.png

0 Kudos
Message 10 of 12
(4,880 Views)