Simple Renaming Script Help

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

JimForest
Posts: 83
Joined: Thu Oct 16, 2008 7:53 pm
Location: MA

Simple Renaming Script Help

Postby JimForest » Mon Dec 19, 2016 7:59 pm

Hello, Hoping someone can help me with a question.

I want to rename series in workfile pages with a script, as I have series with the same names in each page but I want to differentiate between them in a combined worksheet.

For example, I want to create the following strings- prefix1, prefix2, etc...

string prefix1="30_"
string prefix2="OTR"

then I want to run the sc
rename oldname "prefix1"+"prefix2"+oldname

so if the old name of the series was "Bond", it would create the series 30_OTR_Bond

Can someone tell me what I am doing incorrectly? I appreciate your help...

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

Re: Simple Renaming Script Help

Postby EViews Gareth » Mon Dec 19, 2016 10:14 pm

Code: Select all

%newname = prefix1+prefix2+oldname
rename {oldname} {%newname}
Follow us on Twitter @IHSEViews

JimForest
Posts: 83
Joined: Thu Oct 16, 2008 7:53 pm
Location: MA

Re: Simple Renaming Script Help

Postby JimForest » Mon Dec 19, 2016 11:17 pm

Thank you Gareth!!!

Ali was not the greatest...Gareth is the GREATEST!!!

Float like a butterfly, sting like a bee!!!

You are the best. Happy Holidays!!! :D :D :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 31 guests