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: How to rename a list of all consecutive variables in a data set?


From   Amir Sariaslan <[email protected]>
To   [email protected]
Subject   Re: st: How to rename a list of all consecutive variables in a data set?
Date   Fri, 7 Jan 2011 12:55:15 +0100

Eleonora,

Try looping it. Something along the lines of:

foreach `var' of varlist varalpha-varomega {
rename `var' new`var'
}

/Amir

On Fri, Jan 7, 2011 at 12:41 PM, Eleonora Paesen
<[email protected]> wrote:
> Hello,
>
> Does anyone know how to rename a list of consecutive variables
> included in a dataset (as they are ordered in it)?
> I have tried this:
> rename varalpha-varomega newvaralpha-newvaromega
> It does not work.
>
> Many thanks for your help!
>
> Eleonora
> *
> *   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