 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Sat Mar 18, 2006 4:35 am Post subject: |
|
|
| Version 1.5 is uploaded to the original place, with a minor bugfix. |
|
| Back to top |
|
 |
Talley Guest
|
Posted: Tue Aug 08, 2006 8:09 pm Post subject: |
|
|
Laszlo,
We have a huge Courier email sent box that we spend hours cleaning duplicate email addresses out of.
We're new with AHK.
Can you offer any help or suggestions to adapt this code to searching a 50MB or so Courier email sent box for duplicate addresses?
Many thanks!
Michael Talley
| Laszlo wrote: | Here is the third part, removing identical items from lists. The script below is faster than sorting. For each item in the list a local variable is generated, named by the hex representation of the name of the item (which could contain illegal characters for a variable name, like "."). If this name is new, it is the first occurrence of the item, otherwise we cut this item off the list. | Code: | Hexify(x) ; Convert a string to a huge hex number starting with X
{
StringLen Len, x
format = %A_FormatInteger%
SetFormat Integer, H
hex = X
Loop %Len%
{
Transform y, ASC, %x% ; ASCII code of 1st char, 15 < y < 256
StringTrimLeft y, y, 2 ; Remove leading 0x
hex = %hex%%y%
StringTrimLeft x, x, 1 ; Remove 1st char
}
SetFormat Integer, %format%
Return hex
}
ListUniq(ByRef list) ; Remove repeated items from list
{
list = %list%,
c = 0
Loop
{
StringGetPos d, list, `,,, %c% ; search from c
IfLess d,0, { ; No more ","
StringTrimRight list, list, 1
Return
}
StringMid item, list, % c+1, % d-c
hex := Hexify(item) ; Item might not be a valid name
IfEqual %hex%,, { ; 1st occurrence
%hex% = 1
c := d + 1
Continue
} ; Already found
StringLeft left, list,% c-1
StringTrimLeft right, list, %d%
list = %left%%right%
}
} | Test it with | Code: | list = 0,1,2,1,3,02,4,2,1
ListUniq(list)
MsgBox %list% |
|
|
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Tue Aug 08, 2006 9:04 pm Post subject: |
|
|
Although, in theory, the ListUniq function is faster than sorting, in practice the hexify steps eat away this advantage. Because of its simplicity I would use the following approach, after reading in the variable "emails" all the email addresses: | Code: | emails = name@abc.com,name@bcd.com,name@abc.de,name@abc.com,namf@bcd.com,name@abc.de
sort emails, UD`, ; replace "`," with the actual delimiter char, like "`n"
MsgBox %emails% ; write emails back to disk |
|
|
| Back to top |
|
 |
keybored
Joined: 18 Jun 2006 Posts: 343 Location: Phoenix, AZ
|
Posted: Fri Dec 19, 2008 2:53 am Post subject: where is the file? |
|
|
Laszlo,
I don't see the file in the linked location. The first post doesn't seem to show the most recent developments. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Fri Dec 19, 2008 3:35 am Post subject: |
|
|
| The library was written 4 years ago, and AHK has evolved much since then, so one can code the same functions faster and simpler now. For the last 3 years no one showed interest in using the library, so I did not bother maintaining the code. If there were a few requests, I would update it. |
|
| Back to top |
|
 |
Laszlo addict Guest
|
Posted: Fri Dec 19, 2008 4:12 am Post subject: |
|
|
| Laszlo wrote: | | The library was written 4 years ago, ... If there were a few requests, I would update it. |
Laszlo, It is always a pleasure to read and (try to) understand your scripts. It seems that every new post you make, there is something to be learned from it. I would certainly like to see an update of you list functions.
Thanks for all of your contributions to these forums.  |
|
| Back to top |
|
 |
keybored
Joined: 18 Jun 2006 Posts: 343 Location: Phoenix, AZ
|
Posted: Fri Dec 19, 2008 7:26 am Post subject: remove x lines |
|
|
Laszlo, I was specifically looking for "ListDel" I think. Some easy way to remove the first item in a list anyway. To use while I make a script using some other code you posted .
Making a script to track keystrokes. I'll post what I have there.
http://www.autohotkey.com/forum/topic2919.html |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Fri Dec 19, 2008 6:32 pm Post subject: Re: where is the file? |
|
|
| keybored wrote: | | I don't see the file in the linked location. | I uploaded both files to AutoHotkey.net and updated the url's in the first post. |
|
| Back to top |
|
 |
JoeSchmoe
Joined: 17 Feb 2008 Posts: 303
|
Posted: Sat Jan 03, 2009 3:17 am Post subject: |
|
|
Hi, Laszlo,
Thanks a lot for posting the links to the normal and experimental versions on Autohotkey.net. They are going straight into lib folder. Would love to see any updates you make.
JS |
|
| Back to top |
|
 |
guest3456 Guest
|
Posted: Tue Aug 03, 2010 4:00 pm Post subject: |
|
|
| Laszlo wrote: | | The library was written 4 years ago, and AHK has evolved much since then, so one can code the same functions faster and simpler now. For the last 3 years no one showed interest in using the library, so I did not bother maintaining the code. If there were a few requests, I would update it. |
i'd love an update, if you think its worth it. otherwise these are good  |
|
| Back to top |
|
 |
guest3456 Guest
|
Posted: Tue Aug 03, 2010 4:09 pm Post subject: |
|
|
for example i think this
| Code: |
ListRemove(text,opt,list)
|
should be like so:
| Code: |
ListRemove(text, ByRef list, opt=0)
|
|
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Tue Aug 03, 2010 4:19 pm Post subject: |
|
|
Thanks for the interest. However, since AHK is not developed any further, its bugs are not getting fixed, writing AHK scripts for anything but very simple Windows automation tasks is wasting our time. The new flavors of the language require different logic, so this library might not be needed for them at all. We have to move on...  |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Aug 05, 2010 10:08 am Post subject: move on to? |
|
|
I haven't followed any discussions about alternatives. May I ask what you intend to move on to? It's sad to see that AHK isn't updated anymore
| Laszlo wrote: | Thanks for the interest. However, since AHK is not developed any further, its bugs are not getting fixed, writing AHK scripts for anything but very simple Windows automation tasks is wasting our time. The new flavors of the language require different logic, so this library might not be needed for them at all. We have to move on...  |
|
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Thu Aug 05, 2010 5:27 pm Post subject: Re: move on to? |
|
|
| Anonymous wrote: | | what you intend to move on to? | I am learning Java. It is designed for different purposes, but very powerful, fast enough, good libraries, free. My first simple app runs on my DroidX, on my PC and probably on Linux and OSX (which I don't have to test). |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|