Page 1 of 1

About Renaming Many Series

Posted: Mon Mar 19, 2012 8:44 pm
by kinon902003
If I have 24 series and their names are as follows:

alpha_1999_m1
alpha_1999_m2
alpha_1999_m3
.
.
.
alpha_1999_m12
alpha_2000_m1
alpha_2000_m2
alpha_2000_m3
.
.
.
alpha_2000_m12

I want to rename them to alpha_1 alpha_2 .... alpha_24.

How can I write program code to do it? Thank you!

Re: About Renaming Many Series

Posted: Mon Mar 19, 2012 9:33 pm
by EViews Gareth

Code: Select all

group g alpha_* for !i=1 to 24 %oldname = g.@seriesname(!i) %newname = "alpha" + @str(!i) rename {%oldname} {%newname} next

Re: About Renaming Many Series

Posted: Mon Mar 19, 2012 11:32 pm
by kinon902003
Thank you very much for the code.

May I ask one more thing? How should I write the code to do the rename if what I have is 24 matrix instead of 24 series? I cannot form a group for matrix. Thanks.