Hello everyone,
My data is splitted into many parts and I want to put them together by using an Eviews program. You can see the list of the names of the data files. I tried to use the following command:
for !i=01 to 10
for !j=03 to 12
pageload "D:\data\Call{!i}{!j}.xpt"
next
next
However, it didnot work. Could you please provide a command for that?Thanks in advance.
Sam
Creating loop for loading pages
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
salahaddin
- Posts: 17
- Joined: Thu Dec 11, 2014 7:11 am
Creating loop for loading pages
- Attachments
-
- 1.jpg (54.29 KiB) Viewed 6462 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Creating loop for loading pages
In your case, since you have no spaces, simply try:
The more general solution is:
As an aside, when requesting help, especially with programming, providing precise error messages or details on the results of code rather than "it didn't work" is beneficial. It is hard for someone to help correct a bug if they don't know exactly what the bug is.
Code: Select all
for !i=01 to 10
for !j=03 to 12
pageload D:\data\Call{!i}{!j}.xpt
next
next
Code: Select all
for !i=01 to 10
for !j=03 to 12
%file = "d:\data\call" + @str(!i) + @str(!j) + ".xpt"
pageload %file
next
next
As an aside, when requesting help, especially with programming, providing precise error messages or details on the results of code rather than "it didn't work" is beneficial. It is hard for someone to help correct a bug if they don't know exactly what the bug is.
-
salahaddin
- Posts: 17
- Joined: Thu Dec 11, 2014 7:11 am
Re: Creating loop for loading pages
Thanks Gareth for the help.
However, I got an error shown in the attachment. I think eviews reads "01" as "1" thus instead of "Call0103" eviews tries to find "Call13".
Please help.
Thanks in advance,
Sam
However, I got an error shown in the attachment. I think eviews reads "01" as "1" thus instead of "Call0103" eviews tries to find "Call13".
Please help.
Thanks in advance,
Sam
- Attachments
-
- 11.jpg (20.95 KiB) Viewed 6439 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Creating loop for loading pages
Code: Select all
for !i=01 to 10
for !j=03 to 12
%i = @str(!i, "i02")
%j = @str(!j, "i02")
%file = "d:\data\call" + %i + %j + ".xpt"
pageload %file
next
next
-
salahaddin
- Posts: 17
- Joined: Thu Dec 11, 2014 7:11 am
Re: Creating loop for loading pages
Thanks Gareth,
u saved my time. U r Gareth Great:)
Thanks,
Sam
u saved my time. U r Gareth Great:)
Thanks,
Sam
Who is online
Users browsing this forum: No registered users and 2 guests
