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]

Re: st: middle initial


From   Michael Eisenberg <[email protected]>
To   [email protected]
Subject   Re: st: middle initial
Date   Wed, 28 Dec 2011 12:37:42 -0800

Thanks Nick.  Brilliant as always.

On Wed, Dec 28, 2011 at 12:28 PM, Nick Sanders <[email protected]> wrote:
> Whoops - typo, should be "substring", not "susbstring".
>
>
> On Dec 28, 2011, at 2:23 PM, Nick Sanders <[email protected]> wrote:
>
>> Hi Mike,
>>
>> Try the substring command:
>>
>> gen midinitial = susbstring(middlename,1,1)
>>
>> That should do it!
>>
>> Best,
>> Nick
>>
>>
>>
>> On Dec 28, 2011, at 2:12 PM, Michael Eisenberg <[email protected]> wrote:
>>
>>> Colleagues,
>>>
>>> I have what I hope will be a simple question to answer.
>>>
>>> I have a list of middle names and I'd like to isolate the first initial.
>>>
>>> I tried but it gives me the letter with ... after it.
>>>
>>> gen midi=middlename
>>> format midi %1s
>>>
>>> Thank you in advance.
>>>
>>> Mike
>>> *
>>> *   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/
>>
>> *
>> *   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/
>
> *
> *   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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index