Re: Sort a List with Integers & Letters
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