Command Reference : Command Reference
  
 
write
Write EViews data to a text (ASCII), Excel, or Lotus file on disk.
Creates a foreign format disk file containing EViews data. May be used to export EViews data to another program.
Unless you need to write your workfile data in transposed form, we recommend that you use the more powerful command for writing a workfile page documented in pagesave.
Syntax
write(options) [path\]filename arg1 [arg2 arg3 …]
Follow the keyword by a name for the output file and list the series to be written. The optional path name may be on the local machine, or may point to a network drive. If the path name contains spaces, enclose the entire expression in double quotation marks.
Note that EViews cannot, at present, write into an existing file. The file that you select will, if it exists, be replaced.
Options
Options are specified in parentheses after the keyword and are used to specify the format of the output file.
 
prompt
Force the dialog to appear from within a program.
File type
 
t=dat, txt
ASCII (plain text) files.
t=wk1, wk3
Lotus spreadsheet files.
t=xls
Excel spreadsheet files.
If you omit the “t=” option, EViews will determine the type based on the file extension. Unrecognized extensions will be treated as ASCII files. For Lotus and Excel spreadsheet files specified without the t= option, EViews will automatically append the appropriate extension if it is not otherwise specified.
ASCII text files
 
na=string
Specify text string for NAs. Default is “NA”.
names (default) / nonames
[Write / Do not write] series names.
dates / nodates
[Write / Do not write] dates/obs. “Dates” is the default unless the “t” option for writing by series is used, in which case “nodates” is the default.
d=arg
Specify delimiter (default is tab): “s” (space), “c” (comma).
t
Write by series. Default is to write by obs with series in columns.
Spreadsheet (Lotus, Excel) files
 
letter_number
Coordinate of the upper-left cell containing data.
names (default) / nonames
[Write / Do not write] series names.
dates (default) / nodates
[Write / Do not write] dates/obs.
dates=arg
Excel format for writing date: “first” (convert to the first day of the corresponding observation if necessary), “last” (convert to the last day of the corresponding observation).
t
Write by series. Default is to write by obs with series in columns.
Examples
write(t=txt,na=.,d=c,dates) a:\dat1.csv hat1 hat_se1
Writes the two series HAT1 and HAT_SE1 into an ASCII file named DAT1.CSV on the A drive. The data file is listed by observations, NAs are coded as “.” (dot), each series is separated by a comma, and the date/observation numbers are written together with the series names.
write(t=txt,na=.,d=c,dates) dat1.csv hat1 hat_se1
writes the same file in the default directory.
Cross-references
See “Exporting to a Spreadsheet or Text File” for a discussion. See pagesave for a superior method of exporting workfile pages to foreign formats.
See also read.