Page 1 of 1

Import only one cell from Excel

Posted: Tue Oct 11, 2016 2:23 am
by pelleenglund
Hello,

I am using the import-command to read data from an Excel file to EViews, but I only want to read a specific cell. The code could look like this:

Import C:\Temp\Data.xlsx Range="Tmp!A2:A2" @Freq 2016M09 @Rename Series01 Test

In the excel file I also have data in columns B and C, and with this command this data are also imported to EViews. Is this a bug? Or can I not import only one cell from Excel to EViews?

Best regards,
Pelle

Re: Import only one cell from Excel

Posted: Tue Oct 11, 2016 8:50 am
by EViews Steve
By default, if you specify a single cell during an import, EViews tries to expand it to include all cells with data to the right and below that point. We can't easily change that as many users depend on that functionality for automatically determining data ranges in an unknown source spreadsheet.

But, you can always tell EViews you only want to keep certain columns by using @keep, like this:

Code: Select all

import C:\Temp\Data.xlsx Range="Tmp!A2:A2" @Freq M 2016M09 @Rename Series01 Test @keep Series01
Steve

Re: Import only one cell from Excel

Posted: Thu Oct 13, 2016 6:56 am
by pelleenglund
That's right, forgot that. Thanks!