Seek for duplicates in an array

Get help with using AutoHotkey and its commands and hotkeys
Albireo
Posts: 399
Joined: 16 Oct 2013, 13:53

Seek for duplicates in an array

21 Feb 2018, 04:28

Is this the only way to seek for duplicates in an array?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 08:10

Hi,

Should Field1 and "Field1" be considered as duplicates? Strictly speaking, they are not.
Albireo
Posts: 399
Joined: 16 Oct 2013, 13:53

Re: Seek for duplicates in an array

21 Feb 2018, 08:29

Yes!
Field1 is on at least two places in the example (can be more), and if it is so, the "problem" must be handled.
teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 10:05

Try:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by teadrinker on 21 Feb 2018, 10:27, edited 3 times in total.
teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 10:44

If the matching should be case sensitive:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 11:04

No, sorry, case sensivive example doesn't work properly. :)
teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 11:44

This works:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 15:47

An easier way:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Albireo
Posts: 399
Joined: 16 Oct 2013, 13:53

Re: Seek for duplicates in an array

21 Feb 2018, 17:27

Easier! :? :? (I'm impressed)
Can you explain a little what happen?
(I did not think it was so complicated ...)
//Jan
teadrinker
Posts: 382
Joined: 29 Mar 2015, 09:41
Contact:

Re: Seek for duplicates in an array

21 Feb 2018, 17:48

:) If you don't need the case sensitivity, the code could look simplier:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I just match keys one by one.
User avatar
jeeswg
Posts: 4481
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Seek for duplicates in an array

21 Feb 2018, 19:55

Here are two examples for removing duplicates.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: Calimero 0euf, Zurydix and 26 guests