How to read data from Excel

For questions regarding programming in the EViews programming language.

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

acharyar
Posts: 4
Joined: Wed Apr 10, 2019 7:10 am

How to read data from Excel

Postby acharyar » Wed Apr 10, 2019 10:47 am

When I save data into old excel format (with extension - xls) the following commands work.
FOR %y CAN DNK FIN FRA GER IRL ITL NLD SPN SWE UK US
matrix (29, 29) {%y}
{%y}.read(b8, s = {%k}) "Input-Output Table.xls"
BUT when I have these data with -xlsx extension, these command do not work. What command do I use to make EVIEWs 10 to read these worksheets with an xlsx extension.
Thanks, Ram

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

Re: How to read data from Excel

Postby EViews Gareth » Wed Apr 10, 2019 3:40 pm

The READ command was discontinued in EViews 5.

Use WFOPEN or IMPORT instead.
Follow us on Twitter @IHSEViews

acharyar
Posts: 4
Joined: Wed Apr 10, 2019 7:10 am

Re: How to read data from Excel

Postby acharyar » Thu Apr 11, 2019 8:04 am

Thanks for the prompt response with help.

But still have difficulty in reading the data.
I have the following command. The objective is to read the data from "Input-Output Table.xlsx" and spreadsheet CAN (as I have other spreadsheets in that file). Since there are more rows and columns in the file than I want to read, I am asking it to read starting from B8 to 29 rows and 29 columns. What did I do wrong?
thanks, Ram
matrix (29, 29) canada
canada.wfopen(b8, s = CAN) "Input-Output Table.xlsx"

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

Re: How to read data from Excel

Postby EViews Gareth » Thu Apr 11, 2019 8:15 am

Follow us on Twitter @IHSEViews

acharyar
Posts: 4
Joined: Wed Apr 10, 2019 7:10 am

Re: How to read data from Excel

Postby acharyar » Wed Apr 17, 2019 11:08 am

I had already gone through the link you provided. But I could not follow it well. I am still trying it.

In any case, I wonder why the program cannot be made friendly (and logical and well documented) to make Eviews read multiple excel worksheets with an easy command. I thought that should be the first objective of any econometric software, as it is about data reading and analysing.

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

Re: How to read data from Excel

Postby EViews Gareth » Wed Apr 17, 2019 11:23 am

Drag the Excel file onto EViews. EViews will open it. Can't get much more friendly than that.

If you want the command line equivalent, then after doing it via drag, look at the command capture window.
Follow us on Twitter @IHSEViews

acharyar
Posts: 4
Joined: Wed Apr 10, 2019 7:10 am

Re: How to read data from Excel

Postby acharyar » Wed Apr 17, 2019 12:13 pm

I have multiple worksheets that I want Eviews to read in one file. Then I want to do vector and matrix manipulation prior to doing any analysis. So, I need Eviews command so that I transfer those excel file in Eview matrices so that I can perform manipulation of rows and columns and matrices.

If I had ready-made data to run regression, then DRAG probably would do it. And the benefit of Eviews is its capacity to read and allow manipulation of those data. I used to do it with -read- command before; I still can use -read- command but the file has to be saved with -xls- extension, which my office computer does not allow (to be saved in that old version).

So the files are -xlsx- extension. And I cannot I get it right on how to I make Eview to read an Excel file that is saved with extension -xlsx.

Thanks for your continuous feedback though.

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

Re: How to read data from Excel

Postby EViews Gareth » Wed Apr 17, 2019 12:34 pm

Can't you just drag the file onto EViews and use the capture to figure out the command you want for the opening of the Excel file? All the rest is irrelevant?
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 21 guests