Hello. I am trying to speed up the process of filling the strings in a set of programs I have in Eviews 7. Is there a way to fill a string in a program by wfopen/anything else from an Excel 2010 .xlsx file as you would with normal series?
For example, if I have a columns in Excel like this?
%vars1 %vars2
a q
b f
c d
d t
e u
f m
g g
Is there a way of filling string values from Excel rows/columns so they could be used in the Eviews program as:
%vars1 = "a b c d e f g"
%vars2 = "q f d t u m g"
Thanks
Retrieving a String from Excel?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Retrieving a String from Excel?
You'll have to create a new page, 7 observations long, read them both in as Alpha series, then convert the Alpha series into string variables (looping through the observations one at a time). Painful.
Re: Retrieving a String from Excel?
Thanks for the help. At least I know I'm not missing the simple option. The @elem would work without too much pain I would think, unless it can't handle alpha series? I thought of something like the below on the way home and was going to try it out when I'm back (using @ilast in the loop as the elements in the alpha series I need in the string change in length and are all different lengths).
alpha vars1
For !j=1 to @ilast(vars1)
%vars1 elem(vars1,{!j})
next
alpha vars1
For !j=1 to @ilast(vars1)
%vars1 elem(vars1,{!j})
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Retrieving a String from Excel?
I don't think Alphas have an @ilast.
This would work, assuming you don't have blanks in the middle of each alpha:
This would work, assuming you don't have blanks in the middle of each alpha:
Code: Select all
for !I=1 to @obsrange
%temp = a(!i)
if @len(%temp) then
%vars1 = %vars1 + " " + %temp
else
exitloop
endif
next
Who is online
Users browsing this forum: No registered users and 2 guests
