Object Reference : Object View and Procedure Reference : Matrix
  
 
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.
This routine should realistically only be used in the oft-hand chance that you wish to write into a Lotus file. Improved Excel, text, and other format writing is available in Matrix::export.
Syntax
matrix_name.write(options) [path\filename]
Follow the name of the matrix object by a period, the keyword, and the name for the output file. 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. The entire matrix will be exported.
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.
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”.
d=arg
Specify delimiter (default is tab): “s” (space), “c” (comma).
t
Write by column (transpose the data). Default is to write by row.
Spreadsheet (Lotus, Excel) files
 
letter_number
Coordinate of the upper-left cell containing data.
t
Write by column (transpose the data). Default is to write by row.
Examples
m1.write(t=txt,na=.) a:\dat1.csv
Writes the matrix M1 into an ASCII file named DAT1.CSV on the A: drive. NAs are coded as “.” (dot).
m1.write(t=txt,na=.) dat1.csv
writes the same file in the default directory.
m1.write(t=xls) "\\network\drive a\results"
saves the contents of M1 in an Excel file “Results.xls” in the specified directory.
Cross-references
See “Exporting to a Spreadsheet or Text File” for a discussion.
See also Matrix::export, Matrix::read.