The Import Function

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

The Import Function

Postby tchaithonov » Tue Feb 02, 2010 3:09 pm

Hi All,

I am trying to update my old eviews 6 programs and found out that the import function is not as easy as I thought it would be. Say if I am importing several sheets from the same Excel 2007 file using a loop (same data format in each of these sheets), and the top leftmost numeric value of these sheets all start in the cell B6, how should I specify the import function?

So far, I have:

Code: Select all

import(type="excelxml", page=Daily) %file_loc range={%tab_current}
where %file_loc is the location of the file, and the %tab_current is the current tab name. I wonder how I can make it read only from B5 (variable names)? Please let me know. Thanks.

Tchaithonov

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: The Import Function

Postby EViews Jason » Tue Feb 02, 2010 4:15 pm

something similiar to

Code: Select all

import(t=excelxml) book1.xlsx range="sheet2!a1:a10"
will work

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: The Import Function

Postby EViews Gareth » Tue Feb 02, 2010 5:09 pm

Further to Jason's response, since the "range" argument is expecting something enclosed in quotes, you probably don't want to put braces around your %tab_current variable, since putting braces around a string variable effectively removes the quotes.

You should also take a look at the program in the last post of this thread, since it does something pretty similar to what you are doing.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests