Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: ST: variable editing


From   "Howrey, Bret T." <bthowrey@UTMB.EDU>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ST: variable editing
Date   Wed, 25 Jun 2008 10:09:37 -0500

Use trim(variable_name) to eliminate leading and trailing blanks

b

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eric Uslaner
Sent: Wednesday, June 25, 2008 10:06 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: ST: variable editing

Thanks Mike, Zhiqiang, and Friedrich for your help.  One other issue.  On either Zhiqiang's or Friedrich's solutions, the result for country names with one or two asterisks is to delete the asterisks (as desired, thanks), but to leave a trailing blank, so that:

Albania*

becomes

Albania_

where _ is not an underscore but simply a left-shifted blank that is not the same as:

Albania

in another data set that I want to merge with this data set.

So when I do

mmerge country using otherdataset

and then sort _merge and clist _merge country

I get Albania in one data set and Albania_ in the second data set, with the merged data set now having both, while they should be matched.  Any help would be appreciated.

Ric Uslaner






*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index