Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Generating a new var from last 11 character in a string


From   lars Folkestad <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Generating a new var from last 11 character in a string
Date   Sat, 14 Dec 2013 23:53:29 +0100

Dear listers

I want to do generate a new var from the last 11 character of a string variable. I normally count the possitions that i want and use the substring command, but my oldvar has contains different number of characters. The first position of interest maybe nr 1 in some observations and number 15 in others. 

Whats the best way to do this?

Lars
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index