Reading and Writing Data using Delimited ASCII files
READPRN("file") Returns an array containing the contents of the ASCII
file.
WRITEPRN("file", [M]) Writes the contents of
the arrayM to a
delimited ASCII file. This function can be used either on the right or the left
side of the definition operator.
When used on the right, you must supply the argument M,
the name of the matrix to write to the file. In this case, the function returns
the contents of the matrix. When used on the left, do not supply the argument
M, but instead place it on the right-hand side of the definition.
See the QuickSheet Example.
APPENDPRN("file", [M]) Writes the contents of
the arrayM to the
end of a delimited ASCII file. The number of columns in the array must match
the number of columns in the existing file. If the file does not exist, APPENDPRN
creates it. Comments about WRITEPRN apply.
M is an array, or, for WRITEPRN, it may be a
scalar.
Notes:
Files should be ASCII text only, with data arranged in rows and columns
separated by spaces or tabs. A text header is allowed; however, once READPRN
encounters a number, it assumes data has begun, so headers should contain
no numbers. If complex, string, or nested matrix values are written to a PRN
file, a header is created allowing READPRN to reconstruct the array. To read a wider variety of file types with more control, use READFILE.
Data files can contain numbers in engineering, complex, or string format,
or nested arrays.
By default, WRITEPRN and APPENDPRN append four significant digits in
columns eight digits wide. To change this setting, choose Worksheet
Options from the Tools menu
and click on the Built-In Variables
tab in the dialog box. Change the precision (PRNPRECISION) and the column width (PRNCOLWIDTH).
Data may not be hexadecimal, octal or binary. To read and write binary files,
use READBIN and WRITEBIN. To read and
write file formats from other applications, or with more import options, use
data components.