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]

Re: st: rename middle parts of variables


From   Hewan Belay <[email protected]>
To   [email protected]
Subject   Re: st: rename middle parts of variables
Date   Mon, 7 Feb 2011 06:28:07 -0800 (PST)

Great, thank you! I only used renvars to rename vars as in 
renvars x y \ a b
I didn't know about all its other wonderful functions!
Hewan

--- On Mon, 2/7/11, Richard Goldstein <[email protected]> wrote:

> From: Richard Goldstein <[email protected]>
> Subject: Re: st: rename middle parts of variables
> To: [email protected]
> Date: Monday, February 7, 2011, 2:18 PM
> download -renvars- from ssc (-ssc
> install renvars-)
> 
> Rich
> 
> On 2/7/11 9:13 AM, Hewan Belay wrote:
> > Dear Statalist,
> > 
> > I have a fairly simple question: I want to rename
> parts of variables; for example, I want to rename any part
> of a variable that is “gdp” to “inc”. So the command
> I’m looking for, once executed, would rename the variable
> algergdppur to algerincpur, and gdp2004 to inc2004, and
> turkey_gdp to turkey_inc. That is, the part of the variable
> I want to rename could show up anywhere in the variable: at
> the beginning, middle, or end. If there are a large number
> of variables, doing –rename- won’t do. Nor can I use
> renpfix or rensfix as these are only for cases where the
> part to be renamed is at the beginning or end (most of my
> cases are in the middle). Is there any straightforward way
> to do this?
> > 
> > Thanks!
> > Hewan
> *
> *   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/
> 


      

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