Jump to content
UBot Underground

[Solved]Finding Duplicates within a list and saving them to another list


Recommended Posts

I've been trying to solve this and just can't seem to figure out how:

 

List 1 contains the values:  Red, Blue, Green, Red, Yellow, Blue, Orange

 

What I am trying to do is identify any duplicate value(s) in List 1 and save those value(s) to List 2

 

In the above example, List 2's values would then be: Red, Blue

 

I am sure there is an easy way to do this, but I think lack of sleep is taking it's toll on me!

Link to post
Share on other sites

You can do this:

1st use two lists and add all values to both, but use different options (first list shouldn't "delete duplicates" set to YES and the second one to NO)

2nd subtract the list without duplicates from original list, and you will get left with duplicates.

Link to post
Share on other sites

You can do this:

1st use two lists and add all values to both, but use different options (first list shouldn't "delete duplicates" set to YES and the second one to NO)

2nd subtract the list without duplicates from original list, and you will get left with duplicates.

This was the exact approach I was trying, but it looks like subtract lists subtracts all instances of the duplicate values so it removes all Reds and Blues from the first list and not just one instance of them. I keep getting an empty list as a result...

 

I also played around with common list items using the above approach of creating the multiple files but can't think of a way to make that work because I think that will only returns the non-duplicate items and excluding the ones I actually want.

Link to post
Share on other sites

Take a look at TJ's video about filtering lists, this my help you https://www.botguru.net/ubot-studio-tutorials/filtering-lists-remove-from-list-ubot-studio-v4/

Thanks, I think this is the approach that I need to take!  The common list item approach above returns a list of just the unique common items without duplicates of those values.  Thanks again.  I may get to sleep tonight afterall!

  • Like 1
Link to post
Share on other sites

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.

Loading...
×
×
  • Create New...