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 Moderator, EViews Jason, 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 Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Import a large number of excel files
Use our IMPORT command instead.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
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 Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Import a large number of excel files
Once you've entered a forum group page (such as this Programming group), simply click the "New Topic*" button. It looks like this: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
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"
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- 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
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 Steve
- EViews Developer
- Posts: 844
- 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
thank you SteveOnce you've entered a forum group page (such as this Programming group), simply click the "New Topic*" button. It looks like this: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
new_topic.png
Steve
Who is online
Users browsing this forum: No registered users and 2 guests
