perhaps the following??
destring oldID, gen(newID) ignore(". -" )
hope this helps,
clint
On 16 Jun 2005 at 16:01, Fernando Augusto Proietti wrote:
> Dear all,
>
> I have a huge data set. The ID variable is like that:
>
> 05.81-0120
> 25.63-0208
>
> and so on.
>
> I want to create a ne ID1 variable, without the "." and the "-", and
> keeping the 0 before the first number:
>
> 05810120
> 25630208
>
>
> Thanks in advance.
>
> Fernando
>
Clinton J. Thompson
Econometrica, Inc.
4416 East-West Highway, Suite 215
Bethesda, MD 20814
Phone: 240-333-4803
Fax: 301-657-3140
www.EconometricaInc.com
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. Any review, re-transmission,
dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities
other than the intended recipient is prohibited. If you
received this in error, please contact the sender and
delete the material from any computer.
*
* 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/