Brian Dunning's FileMaker Custom Functions

fnAddressParser ( address ; type )

This CF parses address parts, allowing developers to create calculation fields for single address fields for display and sorting.

  Average rating: 4.4 (39 votes) Log in to vote

Drew Wesley   Drew Wesley - Show more from this author
Drewsol
https://www.drewsol.com

Share on Facebook Share on Twitter

  Sample input:
fnAddressParser ( "123 W. 3rd St. #12, Los Angeles, CA 90040" , "Street" )

fnAddressParser ( "123 W. 3rd St. #12, Los Angeles, CA 90040" , "StreetSort" )

fnAddressParser ( "
Drew Wesley
Drewsol
123 W. 3rd St. #12
Los Angeles, CA 90040
" , "City" )
  Sample output:
W. 3rd St.


003 St., #21


Los Angeles

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This CF parses address parts, allowing developers to create calculation fields for single address fields for display and sorting.

 

Comments

David Graham   David Graham, San Diego, CA
Oct 2, 2009
I don't get the whole point behind the trademark symbol in Drewsol's function names. Is the author claiming that the name of the function uniquely identifies his business?

I see nothing unique in the name of this author's custom function names to warrant common law protection. In addition, the product itself is released under open-source license, so it baffles me that the author would seek to protect the name of a product that the author has released ownership rights to. Color me puzzled?!?!?

Dave Graham
dave at bittailor dot com
 
CA   CA, Cincinnati
Oct 29, 2009
//http://en.wikipedia.org/wiki/Street_name#Street_type_designations

Does this not include 'Court'
 
Drew Wesley   Drew Wesley, Drewsol
Oct 30, 2009
Now it does!
 
Christian Sauve   Christian Sauve, Montreal
Jul 26, 2013
Great function!
 
Rani Taylor   Rani Taylor, Frederick, MD
Sep 20, 2013
Is there a way to include the "Unit type" when parsing out the unit number? i.e. "Apt. 345 "instead of "345". I was hoping to use this to separate Primary address info from secondary.
 
Drew Wesley   Drew Wesley, Drewsol
Sep 20, 2013
@Rani - I just updated the function. Use "unit_type" as the parameter. :)
@Christian - Thanks!
 
Craig Watson   Craig Watson, Kailua Kona /Hawaii
Jan 22, 2014
Thanks for this function. I am a little lost which type selection to use parse an address so it
fits in a standard 6 field address line.
For example 731 S. Lewis st Apt 34
I need each item individually
731
S
Lewis
ST
Apt
34
I can get the 731 with "address_Number"
I can get the S with "Direction_prefix_v1"
I can get the 34 with "Unit"
Unable to get street name alone without the direction, the unit type (using("unit_Type") and street type (St.)
 
David Simmons   David Simmons, Ideawise
Jun 28, 2019
Great function. Here's a more extensive list of street type designations. I transformed them all into the formula version and tried to put them in the calculation, but apparently this puts it over a 30,000 character limit which I didn't even know existed.

Probably for the best though. Some might actually cause it to parse in the wrong place. I pulled a few dozen that I thought were useful (Freeway, Highway, Expressway, Pike, etc) and went with that.

I'm unclear though on how to pull P.O. Box. It appears to be detecting it, and I keep a separate field for P.O. Box as differentiated from Street Address. But it doesn't appear that it can be parsed as a separate "type". If I'm missing something please let me know.

Thanks for the function. Well done.
 
David Simmons   David Simmons, Ideawise
Jun 28, 2019
Forgot to include the link to the list:
https://pe.usps.com/text/pub28/28apc_002.htm
 
Zhava   Zhava
Jul 17, 2019
Wonderful function! A small bug - if a street name starts with "St" such as "State Road" or "Stanley Ave." it does not parse the rest of the address correctly. I'm guessing it thinks it is the beginning of "Street," but I don't know how to fix it.
 
 
Sep 17, 2021
How do I use this function? Are there docs? I went to the developers website, but it's just one page. I found an old email but it seems the mailbox is full. Can anyone help?
 
Drew Wesley   Drew Wesley, Drewsol
Dec 28, 2021
Hi, I'm just seeing the most recent comments after a long while and will respond to them.
 
Martin Pineault   Martin Pineault, f.i.SCIENCES Développement inc.
Nov 22, 2023
Hi Drew,
I'm trying to make it Canadien compatible with French support.
I ran into a bug, the char '-' (minus) is not supported in the street name.

Thank you.
 
Martin Pineault   Martin Pineault, f.i.SCIENCES Développement inc.
Nov 22, 2023
I found out that it's because or the function "MiddleWords()".
 
Martin Pineault   Martin Pineault, f.i.SCIENCES Développement inc.
Nov 23, 2023
I found out that it's because or the function "MiddleWords()".
 
Martin Pineault   Martin Pineault, f.i.SCIENCES Développement inc.
Nov 23, 2023
I found out that it's because or the function "MiddleWords()".
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: