Page 1 of 1

Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 5:39 am
by yoniboi
how do i import along with the variables (for example v1 to v121) lables that i have made in excel or a csv file.

an example of it would be v1 has a label of gdp and v2 has a label of cpi

(i dont want to write manually 121 labels)

i am using v1-v121 because they will be used later in programs that i am writing and i want the grapical repsentation to have the labels of the variables and not v1-v121.

thanks

yoniboi

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 7:59 am
by EViews Gareth
Assuming you have the name in the first row, and the label in the second row, when you open the Excel file in EViews, on the second page of the Excel read dialog there is a section that lets you specify the header rows. Change this so that is says there are two rows of headers, and the name is in the first row. EViews will then read the second row as a description.

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 9:54 am
by yoniboi
Thank you for the quick response, but what i need is for the second feild to go into the label not the description, so when i make graphs and such the label will show up and not the generic variable name i give it.

thank you

yoniboi

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 10:15 am
by EViews Gareth
I think you're confusing "display name" and "label", but I understand what you mean. There is no way to import the description as a display name.

If you're using EViews 7, you can do something along the lines of:

Code: Select all

%s = x.@description x.displayname {%s}
where X is the name of a series. Obviously if you have lots of series, you could write a for loop to loop through them all doing the same thing.

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 10:29 am
by yoniboi
I cannot use the same code for Eviews 6 or a variation of it?

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 10:39 am
by EViews Gareth

Code: Select all

freeze(t) x.label %s = t(6,2) d t w1.displayname {%s}

Re: Importing lables from ascii or excel files

Posted: Mon Oct 12, 2009 12:22 pm
by yoniboi
that code worked great thanks