Statalist


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

st: RE: ST: variable editing


From   "Howrey, Bret T." <[email protected]>
To   "'[email protected]'" <[email protected]>
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: [email protected] [mailto:[email protected]] On Behalf Of Eric Uslaner
Sent: Wednesday, June 25, 2008 10:06 AM
To: [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index