how to import a serie from excel into an existing wrokfile

For questions regarding programming in the EViews programming language.

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

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

how to import a serie from excel into an existing wrokfile

Postby melamel » Thu May 12, 2016 6:28 am

I want to import a serie from an excel file which is called DM-INF into an existing workfile, how can I do it please?
I used the command capture and it gave me this command:

Code: Select all

import "C:\Users\amel.laref\Desktop\Nouveau dossier\DM-INF.xlsx" range='Alger 2001'!$F$73:$FT$73 byrow colhead=0 namepos=all na="#N/A" names=(ipc) @freq M 2002M01 @smpl @all
But when copying it in a program, all the part which comes after the single quotation (') is interpreted as a comment so it's not taken into account. How can I fix the problem please?
Thank you for your responses!

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

Re: how to import a serie from excel into an existing wrokfi

Postby EViews Gareth » Thu May 12, 2016 7:25 am

Code: Select all

import "C:\Users\amel.laref\Desktop\Nouveau dossier\DM-INF.xlsx" range="'Alger 2001'!$F$73:$FT$73" byrow colhead=0 namepos=all na="#N/A" names=(ipc) @freq M 2002M01 @smpl @all

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

Re: how to import a serie from excel into an existing wrokfi

Postby melamel » Thu May 12, 2016 8:01 am

Thank you very much !

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: how to import a serie from excel into an existing wrokfi

Postby EViews Steve » Thu May 12, 2016 12:05 pm

This was a bit tricky to fix as EViews wants to use single quotes for long sheet names in a lot of different places and single quotes are almost ALWAYS considered a comment in an EViews program. Gareth's solution of just using double quotes around the whole range value works, but also looks a bit unwieldy when it's just the long sheet name, like this:

Code: Select all

range="'Alger 2001'"
So I changed EViews to use double quotes instead. Either of the following will now work (after the next patch):

Code: Select all

range="Alger 2001"!$F$73:$FT$73
(this is what you'll see generated by our command capture window now)

or

Code: Select all

range = "Alger 2001!$F$73:$FT$73"
For backwards compatibility, single quotes will continue to work just fine in the command window post patch. But in an EViews program, you can now use the captured command which uses double quotes.

Steve

melamel
Posts: 30
Joined: Tue May 10, 2016 3:49 am

Re: how to import a serie from excel into an existing wrokfi

Postby melamel » Wed May 18, 2016 1:34 am

That's really great ! Thank you a lot ! :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests