Save Eviews data in CSV file

For questions regarding programming in the EViews programming language.

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

nidhijain
Posts: 9
Joined: Tue Jan 16, 2018 2:10 am

Save Eviews data in CSV file

Postby nidhijain » Thu Mar 27, 2025 2:40 am

I am Eviews 13 user.
I am working on creating a UI on top of Eviews using python.

for performance increase, i am trying to load data in UI from CSV file, which is prepared as :

1. I ran "show" statement with selective series in Eviews
2. data is displayed in table format,
3. Rt click on table, there is option "Save Table to Disk", where i select csv and save the selected output in csv file.

Now i want to achieve same from python code use Eviews Manager.
Is there any option or command by which the output of the show command can be saved in csv file.
I can call the same command in Eviews_app.run() method to solve the purpose.

Kindly help.

nidhijain
Posts: 9
Joined: Tue Jan 16, 2018 2:10 am

Re: Save Eviews data in CSV file

Postby nidhijain » Thu Mar 27, 2025 2:41 am

Thanks Steve for you reply on this as :

I would recommend not using SHOW but instead use WFSAVE(type=text). To limit it to just a few series, add the @keep (or @drop) argument:
Code: Select all

wfsave(type=text) output.csv @keep series1 series2

nidhijain
Posts: 9
Joined: Tue Jan 16, 2018 2:10 am

Re: Save Eviews data in CSV file

Postby nidhijain » Thu Mar 27, 2025 2:43 am

wfsave(type=text) d:\output.csv @keep crude_brent gdp_gr_*
Thanks it worked, but the first column is _date_ which has date (1990-01-01,) by default in csv.... i want it to be only year (1990).

How to do that.


Kindly help

nidhijain
Posts: 9
Joined: Tue Jan 16, 2018 2:10 am

Re: Save Eviews data in CSV file

Postby nidhijain » Thu Mar 27, 2025 5:44 am

Thanks, I finally got my answer from some earlier post and Eviews documentation as well.
Replying, if anyone is looking for such reference
It goes like :
alpha mydates = @datestr(@date, "YYYY")
wfsave(type=text) d:\output.csv byrow @keep mydates gdp_* @drop _date_


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests