Statalist The Stata Listserver


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

Re: Re: st: rename


From   "Ada Ma" <[email protected]>
To   [email protected]
Subject   Re: Re: st: rename
Date   Wed, 29 Mar 2006 14:28:13 +0100

-renpfix- should help you.



On 3/29/06, Hans J. Baumgartner <[email protected]> wrote:
> Thank you Ulrich for the answer.
>
> Your suggestions work fine but I have no idea where this local comes from
> and WHY&HOW it is working.
>
> `=subinstr("`var'","_","",.)'
>
>
> [email protected] schrieb am 29/03/2006 13:24:29:
>
> > Hans J. Baumgartner wrote:
> > > some of my data?s variables have an leading underscore but not all,
> i.e.:
> > >
> > > _var1 _var2 _var3 var4 var5 _var 6
> > >
> > > How can I remove the leading underscore to get
> > >
> > > var1 var2 var3 var4 var5 var6
> >
> > forach var of varlist _all {
> >    rename `var' `=subinstr("`var'","_","",.)'
> > }
> >
> >
> >
> > --
> > [email protected]
> > +49 (030) 25491-361
> > *
> > *   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/
>


--
Ada Ma
Research Fellow
Health Economics Research Unit
University of Aberdeen, UK.
http://www.abdn.ac.uk/heru/
Tel: +44 (0) 1224 553863
Fax: +44 (0) 1224 550926

*
*   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