• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sorting IP addresses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Sorting IP addresses
      • From: Marconi <email@hidden>
References: 
 >Sorting IP addresses (From: Marconi <email@hidden>)
 >Re: Sorting IP addresses (From: Steve Mills <email@hidden>)
 >Re: Sorting IP addresses (From: Graff <email@hidden>)
 >Re: Sorting IP addresses (From: Marconi <email@hidden>)

  • Prev by Date: Re: Parsing PDF; looking to count number of markup annotations
  • Next by Date: Re: Sorry
  • Previous by thread: Re: Sorting IP addresses
  • Next by thread: Re: Sorting IP addresses
  • Index(es):
    • Date
    • Thread