Hi,
I use Eviews 13 Enterprise. I am trying to import Excel files to extract values, in order to reconstruct at the end times series.
Basically, the structure looks like it:
Gross Domestic| |Household | |Gross Fixed
Product ||Consumption ||Investment
Prev 1 | Prev 2 | Prev 1 | Prev 2 | Prev 1 | Prev 2
4,296 | 2,205| 5,839 |2,221 |4,922 | 2,801
(each | indicates a column)
I try to import this by making six series: gross_domestic_product_year1, gross_domestic_product_prev2, household_consumption_prev1, household_consumption_prev2, gross_fixed_investment_prev1, gross_fixed_investment_prev2.
The issue is that the first two lines are on the cells of the left: so when I import, I have gross_domestic_product_prev1, prev2, household_consumption_year1, prev201, gross_fixed_investment_prev1, prev202.
If the names on the first two lines were duplicated above Prev2, there would be no problem.
Is there still a way to import my six series?
Regards.
Importing complex Excel files
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- EViews Developer
- Posts: 799
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Importing complex Excel files
No, there isn't a way to tell the import command to repeat values from previous cells when reading in the header lines.
I would recommend manually renaming the prev2 series objects after doing the import, like this:
Steve
I would recommend manually renaming the prev2 series objects after doing the import, like this:
Code: Select all
import...
rename prev2 gross_domestic_product_prev2
rename prev201 household_consumption_prev2
rename prev202 gross_fixed_investment_prev2
Steve
Re: Importing complex Excel files
Thanks for your response. The issue is the fact there are a lot more variables than what I showed (so a lot of columns) so I try to find a way to do it automatically... Even with several steps. Do you have any suggestion ?
-
- EViews Developer
- Posts: 799
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Importing complex Excel files
My suggestion is to perform a custom text manipulation before doing the import. You should do this in an external program (such as a custom batch script) as EViews is not designed to be an efficient text manipulation engine. But here's how you would do that using EViews code:
Since the first portion of this code (that performs the text manipulation) is loading the entire source file into memory, you may run into issues if you don't have enough RAM to do this. A custom script can avoid this.
Steve
Since the first portion of this code (that performs the text manipulation) is loading the entire source file into memory, you may run into issues if you don't have enough RAM to do this. A custom script can avoid this.
Steve
- Attachments
-
- prob.prg
- (786 Bytes) Downloaded 8 times
-
- EViews Developer
- Posts: 799
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Importing complex Excel files
I forgot you mentioned that the source file is an Excel spreadsheet. Here's the import statement you would need to use then:
Steve
Steve
- Attachments
-
- prob.prg
- (836 Bytes) Downloaded 9 times
Who is online
Users browsing this forum: No registered users and 6 guests