Assuming this is a string variable ID
gen ID2=substr(ID,1,1)+"0"+substr(ID,2,length(ID)-1)
Best wishes
Paul
2009/2/4 Polis, Chelsea B. <[email protected]>:
> Dear Statalisters,
>
> I need to insert a zero between the first and second characters in a column of study IDs. For example, K04945 must become K004945. Any clues on how to achieve this?
>
> Many thanks!
> Chelsea
>
> *
> * 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/