I need to import a large number of excel files with sheets numbered from 1_ to 100_
Is there an efficient way to import them?
The tentative approaches below give me an error
for !i = 1 to 100
read(e,c2,s={!i}_) OECD_CLI_EA.xls CLI_{!i}
next
for !i = 1 to 100
read(e,c2,s=!i_) OECD_CLI_EA.xls CLI_!i
next
Import a large number of excel files
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Re: Import a large number of excel files
Hi, I'm sorry I am not answering your question but I want to ask for your help. I am a new user on this forum and I would like to post up a question but I do not know how or where to do this. Where do I click? Which icon? Thank you
-
- EViews Developer
- Posts: 798
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Import a large number of excel files
RDS wrote:I need to import a large number of excel files with sheets numbered from 1_ to 100_
Is there an efficient way to import them?
The tentative approaches below give me an error
for !i = 1 to 100
read(e,c2,s={!i}_) OECD_CLI_EA.xls CLI_{!i}
next
for !i = 1 to 100
read(e,c2,s=!i_) OECD_CLI_EA.xls CLI_!i
next
Use our IMPORT command instead.
Just drag one excel file onto the EViews window to start the import wizard. Once you've successfully imported one sheet from the file, look at the IMPORT command that was captured in the captured window and use it as a template for your program.
Steve
-
- EViews Developer
- Posts: 798
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Import a large number of excel files
Nom wrote:Hi, I'm sorry I am not answering your question but I want to ask for your help. I am a new user on this forum and I would like to post up a question but I do not know how or where to do this. Where do I click? Which icon? Thank you
Once you've entered a forum group page (such as this Programming group), simply click the "New Topic*" button. It looks like this:
Steve
Re: Import a large number of excel files
Steve,
I am not sure I understand your point.
I have imported the first file
import OECD_CLI_EA.xls range="1_!c2:c187" @smpl {%startdate2} {%lastdate} @rename series01 cli_AT
Is there a loop I can create around range="1_!c2:c187"
I am not sure I understand your point.
I have imported the first file
import OECD_CLI_EA.xls range="1_!c2:c187" @smpl {%startdate2} {%lastdate} @rename series01 cli_AT
Is there a loop I can create around range="1_!c2:c187"
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Import a large number of excel files
Code: Select all
for !i=1 to 100
%range = @str(!i)+"_!c2:c187"
import OECD_CLI_EA.xls range=%range @smpl {%startdate2} {%lastdate} @rename series01 cli_AT
next
or something similar.
Follow us on Twitter @IHSEViews
Re: Import a large number of excel files
Import is not stable: Eviews crashes.
I continue to prefer read
smpl {%startdate2} {%lastdate}
for %series 1 2 3 4 5 6 7 8 9 10 11 12 13
read(e,c2,s={%series}_) OECD_CLI_EA.xls CLI_{%series}
next
rename cli_1 cli_AT
rename cli_2 cli_BE
rename cli_3 cli_DE
rename cli_4 cli_EA
rename cli_5 cli_ES
rename cli_6 cli_FI
rename cli_7 cli_FR
rename cli_8 cli_GR
rename cli_9 cli_IE
rename cli_10 cli_IT
rename cli_11 cli_NL
rename cli_12 cli_PT
rename cli_13 cli_US
I continue to prefer read
smpl {%startdate2} {%lastdate}
for %series 1 2 3 4 5 6 7 8 9 10 11 12 13
read(e,c2,s={%series}_) OECD_CLI_EA.xls CLI_{%series}
next
rename cli_1 cli_AT
rename cli_2 cli_BE
rename cli_3 cli_DE
rename cli_4 cli_EA
rename cli_5 cli_ES
rename cli_6 cli_FI
rename cli_7 cli_FR
rename cli_8 cli_GR
rename cli_9 cli_IE
rename cli_10 cli_IT
rename cli_11 cli_NL
rename cli_12 cli_PT
rename cli_13 cli_US
-
- EViews Developer
- Posts: 798
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Import a large number of excel files
What version of EViews are you using? And the build date? Mind posting one of your spreadsheets?
Re: Import a large number of excel files
EViews Steve wrote:Nom wrote:Hi, I'm sorry I am not answering your question but I want to ask for your help. I am a new user on this forum and I would like to post up a question but I do not know how or where to do this. Where do I click? Which icon? Thank you
Once you've entered a forum group page (such as this Programming group), simply click the "New Topic*" button. It looks like this:
new_topic.png
Steve
thank you Steve
Who is online
Users browsing this forum: Google [Bot] and 67 guests