Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Two digit prefix to variables


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: Two digit prefix to variables
Date   Thu, 1 Jul 2004 22:00:07 +0100 (BST)

Scott Merryman replied to Dan Reza:

> foreach var of varlist * {
> 	rename `var' foo_`var'
> 	}
>
> Hope this helps,
> Scott

As an alternative, check out Jeroen Weesie's -renvars- package,
downloadable by SSC. An example of how it works taken from the list:

. renvars var1-var10, pre(95)

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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