Hello,
I am trying to simplify a big number of imported series in a Eviews workfile. To this end, I need to remove all the characters after some core name that I want to keep. For example, if I have a series named like:
investment_dy_inv_dy
is there a way of using the wildcard characters to keep "investment_dy" end remove "_inv_dy" (the last part of the name)?
Thanks
removing the end of object names in workfile
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: removing the end of object names in workfile
Code: Select all
rename *_inv_dy *
Follow us on Twitter @IHSEViews
Re: removing the end of object names in workfile
Thank you so much, another such problem is illustrated in the following example. My series names are:
axy_1
bxy23
cxy__gdp
and many other names including xy which, in turn, are followed by different characters.
I want to remove all the characters after xy, but without specifying them one by one because there are a lot of them, and keep only:
axy
bxy
cxy
Is there a way of saying Eviews to remove all the characters after a (some) specified one(s)?
Thank you
axy_1
bxy23
cxy__gdp
and many other names including xy which, in turn, are followed by different characters.
I want to remove all the characters after xy, but without specifying them one by one because there are a lot of them, and keep only:
axy
bxy
cxy
Is there a way of saying Eviews to remove all the characters after a (some) specified one(s)?
Thank you
Re: removing the end of object names in workfile
Hello, please forgive me for coming back to the issue of my last post, I would like to know if there is a way of solving this problem using wildcards or another tool:
My series names are, say:
axy_1, bxyusa, cxy__gdp, ... and many other names including xy which are followed by different characters.
I want to remove all the characters after xy, but without specifying them one by one because I have a large number of such series names and the parts to remove are all different, and keep only:
axy, bxy, cxy, ...
Is there a way of asking Eviews to remove all after xy ?
Thanks
My series names are, say:
axy_1, bxyusa, cxy__gdp, ... and many other names including xy which are followed by different characters.
I want to remove all the characters after xy, but without specifying them one by one because I have a large number of such series names and the parts to remove are all different, and keep only:
axy, bxy, cxy, ...
Is there a way of asking Eviews to remove all after xy ?
Thanks
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: removing the end of object names in workfile
Not with a wildcard. You'd have to write a for loop that loops through them all doing the rename one at a time.
Code: Select all
%list = @wlookup("*xy*", "series")
for %j {%list}
!posxy = @instr(%j, "XY")
%newname = @left(%j, !posxy+1)
rename {%j} {%newname}
next
Follow us on Twitter @IHSEViews
Re: removing the end of object names in workfile
That works! Thanks so much Gareth, this is a great help...
Who is online
Users browsing this forum: No registered users and 26 guests