Importing Labels from xls/xlsx

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

osindi
Posts: 12
Joined: Thu Mar 05, 2015 4:44 am

Importing Labels from xls/xlsx

Postby osindi » Thu Mar 05, 2015 4:52 am

Hello,

Sorry if this has been answered already, haven't found any relevant details so far.
I'm trying to import data from an xls/xlsx file using eviews7.

I'm aware I can use the following command:

Code: Select all

import "path/file.xls" range="Sheet!A4:X100"
However, I often get a date specification error. Does the sheet need to have some sort of standard format with the dates in column A? How would i define the sample / frequency from the code without having the dates in the xls file.

Secondly, I'm also interested in importing the names from excel as well. This seems easy to do if the names are directly above the data, but what if it's a couple rows above the data?

E.g. How would I get the names of the series if it was given in the following format:

Row 1: Name
Row 2:Unwanted details
Row 3:Unwanted details
Row 4:Unwanted details
Row 5: Data starts
...
Row 100: End of Data

Appreciate any help.

Thanks,

osindi

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

Re: Importing Labels from xls/xlsx

Postby EViews Gareth » Thu Mar 05, 2015 10:16 am

Can you provide an example file?

osindi
Posts: 12
Joined: Thu Mar 05, 2015 4:44 am

Re: Importing Labels from xls/xlsx

Postby osindi » Thu Mar 05, 2015 10:37 am

Hi Eviews Gareth,

Sure. So the names I would want are in row 3 of the excel file. And the data starts from row 7.
Thanks,
Attachments
import_test.xls
(30 KiB) Downloaded 663 times

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

Re: Importing Labels from xls/xlsx

Postby EViews Gareth » Thu Mar 05, 2015 10:46 am

Code: Select all

wfopen import_test.xls colhead=4 namepos=first

osindi
Posts: 12
Joined: Thu Mar 05, 2015 4:44 am

Re: Importing Labels from xls/xlsx

Postby osindi » Thu Mar 05, 2015 10:51 am

Thanks. Is there a way to do it using the import (or read function with xlsx)? or at least reading it directly to the current workfile?

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

Re: Importing Labels from xls/xlsx

Postby EViews Gareth » Thu Mar 05, 2015 11:10 am

Change wfopen to import.

osindi
Posts: 12
Joined: Thu Mar 05, 2015 4:44 am

Re: Importing Labels from xls/xlsx

Postby osindi » Thu Mar 05, 2015 11:17 am

great, thanks very much.

One last question though: Is it possible to import when the dates are not available? I guess you would need to specify what the dates are within the import function?

Thanks again!

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

Re: Importing Labels from xls/xlsx

Postby EViews Gareth » Thu Mar 05, 2015 11:32 am

Yes. The import documentation has details.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest