Re: Sorting IP addresses
Re: Sorting IP addresses
- Subject: Re: Sorting IP addresses
- From: Emmanuel <email@hidden>
- Date: Thu, 18 Dec 2003 21:21:06 +0100
At 9:40 AM -0700 18/12/03, Marconi wrote:
>
The answers thus far have not actually addresses the sorting but rather getting the IP addresses into a 'sortable' form.
You could download Smile (4.3 MB) and install it. Then, assuming your list is a list of string l:
- File > New text
- File > New text (again)
- in the front text window, type:
tid(return)
set w to window 2
set text of w to (l as text)
change "(^|\\.)([0-9])(\\.|$)" into "\\100\\2\\3" in w with regexp
change "(^|\\.)([0-9]{2})(\\.|$)" into "\\10\\2\\3" in w with regexp
- select all that text, press Enter
- bring the second window to the front
- Script > More menu bar > Edit > Sort paragraphs
- bring the second window (the window where you script) to the front
- type
change "(^|\\.)[0]+" into "\\1" in w with regexp
set l to text items of (get text of w)
- select those two lines, press Enter
Now l is sorted.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.