Output data to csv

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

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Output data to csv

Postby jthodge » Tue Jan 21, 2014 11:14 am

Over the years, I've noticed that Eviews exports xls files using an outdated Excel format (Excel 2.0?). This has never really been a problem. However, I've now upgraded to Office 2010, and by default this version of Excel opens older version xls files in "protected view" which does not allow editing or linking to newer Excel files.

I know there's a way to turn off this file block behavior in Excel, but as a workaround I'm trying to redo my Eviews code to export the data to csv files. There are two problems I'm running into with trying to create a csv file using the pagesave command:

1.) Eviews is setting the first field in the csv file as a "_date_" field with each observation in the format YYYY-MM-DD. How can I instead output the standard Eviews observation string for this field (e.g. 2014M01)?

2.) Eviews is outputting NA values as literally the string "NA". How can I instead have NAs represented as blank/null values?

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

Re: Output data to csv

Postby EViews Gareth » Tue Jan 21, 2014 11:50 am

Why not just save as .xlsx?

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Re: Output data to csv

Postby jthodge » Tue Jan 21, 2014 11:59 am

We've had trouble opening xlsx files in other software packages. It seems old-fashioned csv files are generally readable by most everything. Xls files used to be a standard file type, but I guess even Microsoft is dropping backward compatibility for its own older-version files.

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

Re: Output data to csv

Postby EViews Gareth » Tue Jan 21, 2014 12:09 pm

1. You can create an alpha series containing the data string you want, and use that alpha series instead of obsid.

2. Via the dialog you can't do anything. Via command you can change the NA representation:

Code: Select all

wfsave(type=txt) myfile.csv na="" delim=","


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests