importtbl/importmat: bug when importing a "one-cell range" from excel

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

mamo
Posts: 80
Joined: Wed Nov 07, 2012 9:11 am

importtbl/importmat: bug when importing a "one-cell range" from excel

Postby mamo » Thu Nov 09, 2017 5:47 am

Dear Eviews team,

I use Eviews 9.5, 27 December 16 build

I found a bug when importing a range covering only one cell in an excel file into a matrix or a table.
For instance, the command

Code: Select all

importtbl(name=testtable, mode=overwrite) "MyExcelFile.xlsx" range="Sheet1!$C$9:$C$9"

imports the whole range right of and below the cell Sheet1!C9 into the table testable, whereas

Code: Select all

importmat(name=testmat, mode=overwrite) "MyExcelFile.xlsx" range="Sheet1!$C$9:$C$9"

imports all the rows below the cell Sheet1!C9 into the matrix testmat.

Same results obtain with the range specification range="Sheet1!$C$99"

Best, mamo

EViews Steve
EViews Developer
Posts: 442
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: importtbl/importmat: bug when importing a "one-cell range" from excel

Postby EViews Steve » Thu Nov 09, 2017 3:22 pm

Thanks for the report. I'll look into it...

EViews Steve
EViews Developer
Posts: 442
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: importtbl/importmat: bug when importing a "one-cell range" from excel

Postby EViews Steve » Thu Nov 09, 2017 3:47 pm

This is actually a bug with the IMPORT (which IMPORTTBL uses internally). If there are other non-blank cells around the cell you're trying to import, IMPORT treats your range as a starting point instead of a start & end point.

This might actually be a feature of IMPORT instead of a bug -- I'll have to investigate further to figure out which.

We'll try to get a fix for this for at least IMPORTTBL and IMPORTMAT soon...

Steve

mamo
Posts: 80
Joined: Wed Nov 07, 2012 9:11 am

Re: importtbl/importmat: bug when importing a "one-cell range" from excel

Postby mamo » Mon Nov 13, 2017 1:32 am

I see your point, yes, this can also be considered as a feature of the procedures importtabl or importmat.
Here a suggestion for future implementations:

Code: Select all

importmat(name=testmat, mode=overwrite) "MyExcelFile.xlsx" range="Sheet1!$C$9:$C$9"

would yield a 1x1 matrix containing only the contents of the cell $C$9, whereas

Code: Select all

importmat(name=testmat, mode=overwrite) "MyExcelFile.xlsx" range="Sheet1!$C$9"

would yield an nxn matrix made up of the contents of the largest coherent range below and to the right of the cell $C$9.

Alternatively, you may also think of introducing an option, retrieve=all/single, so that

Code: Select all

importmat(name=testmat, mode=overwrite, retrieve=single) "MyExcelFile.xlsx" range="Sheet1!$C$9"

retrieves only the contents of cell $C$9.
Best, mamo

EViews Steve
EViews Developer
Posts: 442
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: importtbl/importmat: bug when importing a "one-cell range" from excel

Postby EViews Steve » Thu Nov 16, 2017 5:03 pm

Ok, we changed IMPORT/WFOPEN to honor the Excel end cell specification when the end cell is the same as the first cell. This fix resolves the issue with IMPORTTBL and IMPORTMAT when trying to read in a single Excel cell.

This will be released in the next patch for EViews 10.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests