ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete duplicate entries

I have a 1D array of values, some are duplicates, which I need to delete as I only want one copy of each value.
Is there any quick function to do this?
0 Kudos
Message 1 of 23
(6,357 Views)
Do you want to delete all duplicates or just duplicates that are ajacent to each other?
0 Kudos
Message 2 of 23
(6,352 Views)
If you just want to delete adjacent duplicates here is a simple solution.

Message Edited by Tom Haggerty on 05-01-2007 07:30 AM

0 Kudos
Message 3 of 23
(6,349 Views)

Unfortunately the entries are not nessisary next to each other.

Will your set up still work?

0 Kudos
Message 4 of 23
(6,341 Views)

No, this is only for adjacent entries, but just a little more work and it will do the rest.  I just didn't know what you needed at the time!

 

Tom

0 Kudos
Message 5 of 23
(6,339 Views)

This should work.  Maybe not the best implementation .... but it will work!

 

Message Edited by Tom Haggerty on 05-01-2007 08:10 AM

Message 6 of 23
(6,338 Views)
Thanks Tom, I'll give it a go!
0 Kudos
Message 7 of 23
(6,330 Views)
This one also works and is maybe a little bit faster (delet from array is rather slow)..
 
/Sture
Message 8 of 23
(6,327 Views)

Sture,

If you inititalized an array before the loop, and did a replace array subset inside the loop and after the loop just grab the subset with values....

I believe your code would perform even better.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 23
(6,318 Views)

You mean like the attached picture ? I don't know how to make my pictures visible directly in the message...If I paste a picture inte the message nothing happens, is it a security setting I should change ?

/Sture

 

0 Kudos
Message 10 of 23
(6,309 Views)