Suzy <[email protected]> started a thread on string and numeric
variables and the use of -destring-. In addition to good advice given by
various people, note that there was a broad discussion of this area in
"On numbers and strings" Stata Journal 2(3): 314--329
(2002)
This article gives an overview of numeric and string data types in Stata
and how to convert from one kind to another. It is a little out-of-date
insofar as the -tostring- command has subsequently become part
of official Stata.
Christian Holz posted a program to remove everything but digits
0 to 9 from a string variable. Note that among the characters excluded
are "." (and any other character that might represent a decimal point).
An -egen- function -sieve()- in the -egenmore- package from SSC
is rather more general than Christian's program, but generates
new string variables. I've not used it much.