Re: Capturing parts of text string
Re: Capturing parts of text string
- Subject: Re: Capturing parts of text string
- From: kai <email@hidden>
- Date: Mon, 4 Jul 2005 18:42:27 +0100
On Monday, July 4, 2005, at 04:55 pm, Robert Poland wrote:
Not to "beat a dead horse"...
Oh c'mon Bob - let's! ;-)
I suppose my original suggestion could be modified slightly to handle
Michelle's point about zip+4 codes - and still avoid any critical space
dependency):
--------------------
on locationAsList(l)
set d to text item delimiters
set text item delimiters to item 1 of (l's word -2)
set z to count "0123456789"'s text items
set text item delimiters to ","
tell l's text items to set l to {item 1} & item 2's {text from ¬
word 1 to word -(z + 1), text from word -z to word -1}
set text item delimiters to d
l
end locationAsList
set l to {}
repeat with i in {"Las Vegas, Nevada 89102", "Northbrook, IL 60062",
"Las Cruces, New Mexico 85123-1234"}
set l's end to locationAsList(i)
end repeat
l
--> {{"Las Vegas", "Nevada", "89102"}, {"Northbrook", "IL", "60062"},
{"Las Cruces", "New Mexico", "85123-1234"}}
--------------------
(Incidentally, I understand that the problem subsequently reported by
the OP was more to do with a rogue TID setting - although I've no doubt
that the zip+4 issue would have bitten soon enough...)
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden