Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: Extract information from a string variable


From   "Sherriff, Martyn" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: Re: Extract information from a string variable
Date   Tue, 3 Mar 2009 12:58:11 +0000

I have data set which should have a string identifier of the form LLLNNLLL such as INR80TMA from which I can extract the first 3 letters, 2 numbers and last 3 letters as sub-identifiers. Unfortunately some of the data has been miscoded such as IR1NT.

How can I extract the letter, number, letter code from this, or is it a case of editing all the codes to the correct format. I am using Stata 10.

Many thanks,
Martyn

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index