• 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: String parsing - help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String parsing - help!


  • Subject: Re: String parsing - help!
  • From: Emmanuel <email@hidden>
  • Date: Thu, 21 Nov 2002 22:36:08 +0100

At 11:51 AM -0800 21/11/02, Lui wrote:
There must be an easier way to do the following
parsing...

I have an incoming string '-Name John Smith -Address
123 Home Ave -City San Diego -State California -Zip
92101'

I am trying to capture the values into the
cooresponding fields in FileMaker cells.


Looks like a job for the Regular Expressions:

---------------------------
set s to "-Name John Smith -Address 123 Home Ave -City San Diego -State California -Zip 92101"
matchResult of (find text "-Name (.*) -Address (.*) -City (.*) -State (.*) -Zip (.*)" in s using {"\\1", "\\2", "\\3", "\\4", "\\5"} with regexp)
--> {"John Smith", "123 Home Ave", "San Diego", "California", "92101"}
---------------------------

(using "find text" from the Satimage osax)


I don't know FileMaker well, but I hope you can make something with the list.

Emmanuel
<netiquette> from Satimage-software, the author of the Satimage osax </netiquette>
_______________________________________________
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: String parsing - help!
      • From: Mail Lists Out <email@hidden>
    • Re: String parsing - help!
      • From: Paul Skinner <email@hidden>
References: 
 >String parsing - help! (From: Lui <email@hidden>)

  • Prev by Date: Replacement for "Akua Sweets" in OSX
  • Next by Date: Re: Number of days left in the month
  • Previous by thread: String parsing - help!
  • Next by thread: Re: String parsing - help!
  • Index(es):
    • Date
    • Thread