About Renaming Many Series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

kinon902003
Posts: 12
Joined: Tue Mar 06, 2012 7:26 pm

About Renaming Many Series

Postby kinon902003 » Mon Mar 19, 2012 8:44 pm

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: About Renaming Many Series

Postby EViews Gareth » Mon Mar 19, 2012 9:33 pm

Code: Select all

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

kinon902003
Posts: 12
Joined: Tue Mar 06, 2012 7:26 pm

Re: About Renaming Many Series

Postby kinon902003 » Mon Mar 19, 2012 11:32 pm

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.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest