Statalist The Stata Listserver


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

st: Data management: code to be able to..


From   S J <[email protected]>
To   [email protected]
Subject   st: Data management: code to be able to..
Date   Sun, 3 Jun 2007 13:09:07 -0700 (PDT)

Dear all,

I have a string identifier variable of the form:

id
"LOCALITY_NAMED_ABCD 001"
"LOCALITY_NAMED_F 060"
"HOUSTON 078"
"SAN ANTONIO 112"

The variable id thus has both the name of the locality
in question (say, HOUSTON), and an identifying code
(say, 078).

How can I generate a new variable, idcode, that only
captures the numeric component of id, so that, I get,
for the above 4 cases, the values below:

idcode
1
60
78
112

Thanks for your advice.

Solange.


 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
*
*   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