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 DE-CAPITALISE variables?


From   "Lachenbruch, Peter" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: how to DE-CAPITALISE variables?
Date   Mon, 28 Jun 2010 09:23:56 -0700

renvars varlist,lower
seems easiest

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten buis
Sent: Monday, June 28, 2010 8:58 AM
To: stata list
Subject: RE: st: how to DE-CAPITALISE variables?

--- Josef Montag wrote
> I have a dataset in which all variable names are in CAPITAL letters.
> Is there a simple way how to de-capitalise them?


foreach var of varlist _all {
    local lower = lower(`var')
    rename `var' `lower'
}

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

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