Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Adding a blank space at the end of a variable in preparation for reclink


From   Matthew Krauchunas <[email protected]>
To   [email protected]
Subject   st: Adding a blank space at the end of a variable in preparation for reclink
Date   Sun, 1 Aug 2010 20:59:41 -0400

Hello,

I am trying to clean up street addresses in preparation for a fuzzy
merge via reclink.  I want to change st --> street, ave --> avenue, rd
--> road etc.  I am running into a problem though as those characters
are normally at the end of a string.  Thus, I cannot use commands
like:

replace street_address=subinstr( street_address, " st", " street ", .)
replace street_address=subinstr( street_address, " ave", " avenue ", .)
replace street_address=subinstr( street_address, " blvd", " boulevard ", .)

Because it will change street names like "Stover" in street over.  I
am thinking of adding an extra space at the end of street_address,
running replace commands, and then removing the extra space via rtrim
command.  Does this sound like a good plan of attack?  If so, does
someone know how I can add a space the end of each of these
observations?

Thanks!
Matt
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index