• 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: Sort a List with Integers & Letters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort a List with Integers & Letters


  • Subject: Re: Sort a List with Integers & Letters
  • From: Simon Topliss <email@hidden>
  • Date: Tue, 3 Apr 2007 14:54:23 +0100

Does this help?

set theList to {"1610G", "121ZB", "114", "13", "21124", "121FB", "250G", "240.25", "1610", "15", "240 25", "240"}

set AppleScript's text item delimiters to {ASCII character 10}
set theList to theList as Unicode text
set AppleScript's text item delimiters to {""}

set sortList to paragraphs of (do shell script "echo '" & theList & "' | sort -n -")

--> {"13", "15", "114", "121FB", "121ZB", "240", "240 25", "240.25", "250G", "1610", "1610G", "21124"}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden
References: 
 >Re: Sort a List with Integers & Letters (From: Steven Valenti <email@hidden>)

  • Prev by Date: Re: Sort a List with Integers & Letters
  • Next by Date: Re: Sort a List with Integers & Letters
  • Previous by thread: Re: Sort a List with Integers & Letters
  • Next by thread: Re: Sort a List with Integers & Letters
  • Index(es):
    • Date
    • Thread