On Thu, Jan 28, 2010 at 8:56 AM, Jason Allen <[email protected]> wrote:

> I was asked to post this here instead of emailing folks directly.
>

Thanks--this way everyone can benefit from the discussion.

I just want to find the first comma, strip out everything to the right
> of the comma, including the comma, so I'm just left with the potential
> city name.
>
> 'St. Louis, MO' yields 'St. Louis'
>

Let's say 'St. Louis, MO' is in the variable foo. You can do ListFirst(foo)
to get everything before the comma, so at that point you'd have St. Louis.
You could also use ListLast(foo) to get the state abbreviation after you
strip out the zip.


>
> First thing, I need to run a replace on the string for any instance of
> abbreviations such as 'st. ft. etc'. and replace the matches with
> "saint, fort' etc.
>
> Let's just use st. for now. What's the best way to look for 'st.' and
> replace it with 'saint'?
>

Replace(foo, "St.", "Saint") or ReplaceNoCase(...) if you might have "st."
or "ST." as opposed to "St." and want to replace regardless of the case.

-- 
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca/Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to