I have a dataset of people who were supposed to write the year since when they live in their current dwelling in numerical terms, but some people have also written some text in those cells. Please see the example below. I would be grateful if you could advise me on how I can remove any letters from those observations. For example, instead of having "26 ans", I would have "26". Thank you very much in advance!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input strL M_tro "1999" "2005" "1962" "2015" "1995" "2004" "2017" "2009" "2015" "2014" "2001" "1990" "2015" "2017" "1972" "1950" "2018" "2004" "2015" "2" "1978" "2021" "2002" "1989" "2008" "1990" "2012" "1999" "1995" "2010" "2008" "1982" "1996" "2016" "1975" "1999" "1988" "2017" "16 ans" "1978" "1985" "1987" "1971" "2007" "2018" "2009" "1989" "1996" "2017" "2010" "2019" "1988" "1975" "1991" "1992" "2011" "1990" "2001" "2013" "2009" "2002" "1986" " " "21" "2005" "2003" "5" "2003" "2005" "23" "2012" "2004" "2008" "2014" "2010" "2004" "1978" "2019" "2013" "1984" "1964" "2016" "1989" "1969" "1990" "2010" "2018" "1998" "2020" "2020" "2012" "2015" "27" "1990" "2015" "1997" "1983" "60" "2016" "2006" end
Comment