Hi,
if the variable is numeric, you can try the following:
gen dig6 = int(var/10^7) - int(var/10^8)*10
-radu
On 7/19/05, [email protected]
<[email protected]> wrote:
> Hi,
> I am trying to isolate some digits from a variable to form a new variable.
> For example, I have a variable with 13 digits (e.g. 5101232120011) and I
> want to extract the 6th digit (in this case 3) and make it a separate
> variable. The original variable always has 13 digits in it. I wonder
> whether I can use Stata to do this. I will appreciate suggestions.
> Adolf Mkenda
> Dar es Salaam.
> *
> * 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/
>
*
* 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/