Re: Need your thoughts
Re: Need your thoughts
- Subject: Re: Need your thoughts
- From: Christopher Stone <email@hidden>
- Date: Wed, 23 Feb 2011 04:15:36 -0600
On Feb 23, 2011, at 02:56, Christopher Stone wrote: I use the Satimage.osax's 'find text' command with regular expressions to do my lookups, but you can use tools native to Mac OS X.
______________________________________________________________________
Hey Louie,
set lookupTable to " ------------------------------------------------------------- Christopher Stone___________________________(123) 456-78910 James Dean__________________________________(098) 765-4321 ------------------------------------------------------------- " set chooseFromList to find text "^[^-_]+" in lookupTable all occurrences true ¬ with regexp and string result without whole word and case sensitive set queryStr to choose from list chooseFromList set queryStr to "^" & queryStr & "_+(.+)" set chooseFromResult to find text queryStr in lookupTable ¬ using "\\1" with regexp and string result without whole word and case sensitive
I use tabs in my tables rather than underscores (but tabs don't translate neatly between Script Debugger and Mail.app).
Although regular expressions look like so much gibberish to the uninitiated they make it dead easy to pull data out of text tables.
-- Best Regards, Chris |
_______________________________________________
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