Importing .xlsx files

For questions regarding programming in the EViews programming language.

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

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Importing .xlsx files

Postby RDS » Mon Aug 17, 2015 8:39 am

It seems that Eviews 8 cannot import .xlsx files.
If this statement is incorrect, how do you import such files?

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

Re: Importing .xlsx files

Postby EViews Gareth » Mon Aug 17, 2015 8:53 am

EViews 8 can handle .xlsx files just fine. Both the WFOPEN and IMPORT commands should recognise the type automatically.

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Mon Aug 17, 2015 9:00 am

This file can be imported (.xls):
read(e,b10,s=ip_cpi_un) database_monthly_lastfriday.xls EA_IP US_IP EA_CPI US_CPI EA_UR US_UR EA_loans_hh EA_loans_nfcs

This one does not works (.xlsx):
read(e,b10,s=ip_cpi_un) database_monthly_lastfriday.xlsx EA_IP US_IP EA_CPI US_CPI EA_UR US_UR EA_loans_hh EA_loans_nfcs

It is the same file, just the extensions is different. Any reason?

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

Re: Importing .xlsx files

Postby EViews Gareth » Mon Aug 17, 2015 9:03 am

Yes, you aren't using the WFOPEN or IMPORT commands.

The READ command was discontinued in EViews 4 (way before .xlsx was invented).

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Mon Aug 17, 2015 9:19 am

Unfortunately I could not find the answer in the Command and Programming Reference.

This does not work:
wfopen(e,b10,s=ip_cpi_un) database_monthly_lastfriday.xlsx EA_IP US_IP EA_CPI US_CPI EA_UR US_UR EA_loans_hh EA_loans_nfcs

I need to get the data from cell "b10" in worksheet "ip_cpi_un"

Thanks for your help

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

Re: Importing .xlsx files

Postby EViews Gareth » Mon Aug 17, 2015 9:25 am

What happens if you just try:

Code: Select all

wfopen database_monthly_lastfriday.xlsx

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Mon Aug 17, 2015 9:33 am

In the same file, I have many worksheet.
When I do what you suggest, I get one variable with a time series and other variables with strange names and with a sample size from 1 to 205

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

Re: Importing .xlsx files

Postby EViews Gareth » Mon Aug 17, 2015 9:37 am

You probably need to use the range= argument then to specify which sheet you want.

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Tue Aug 18, 2015 3:29 am

It would be very useful if Eviews could validate the read command also for .xlxs files.
Is one useful value added compared to STATA and RATZ.

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

Re: Importing .xlsx files

Postby EViews Gareth » Tue Aug 18, 2015 6:00 am

The Import and wfopen commands do everything that Read does, and much much more.

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Tue Aug 18, 2015 6:50 am

Can you please make me an example of uploading three time series X Y Z from cell B10 in a worksheet titled "Data" which is in a file titled example.xlxs?

Many thanks.

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

Re: Importing .xlsx files

Postby EViews Gareth » Tue Aug 18, 2015 7:11 am

Code: Select all

import example.xlsx range="data"

RDS
Posts: 86
Joined: Thu Feb 17, 2011 9:50 am

Re: Importing .xlsx files

Postby RDS » Tue Aug 18, 2015 7:17 am

This imports all the worsheet "Data" and not X Y Z.
Immagine I have 100 time series and I want to import only X Y Z starting from cell B10

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

Re: Importing .xlsx files

Postby EViews Gareth » Tue Aug 18, 2015 7:31 am

Code: Select all

Import example.xlsx range="data!b10:whereever"


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests