I have a series of variables I would like to rename - they all have a 4-digit year in the middle; however, the number of characters before/after the year are different for each name. I would like to move the 4 digit year to the end of the variable name and truncate that number to only the last 2 digits. For example, I would like to rename ques2011survey to quessurvey11 and example2012b to exampleb12. I have tried using the regex function (similar to the advice on this thread: http://www.stata.com/statalist/archi.../msg01581.html), but I am still struggling. Thanks in advance for any help!
-
Login or Register
- Log in with
Comment