READFILE("file", "type",
[colwidths], [rows], [cols], [emptyfill]) Returns an array
containing the data in file. The optional arguments give much of the same flexibility found in the Data Import Wizard, for use in programs.
type is a string that specifies
the data format used in the file. READFILE supports the following data types:
delimited - data columns separated by a consistent delimiter (including those produced by WRITEPRN and APPENDPRN).
fixed - fixed-column-width data.
Excel - Excel file formats.
colwidths (required for type "fixed") an n × 1 column vector specifying the number of characters in each fixed-width column, where n is the total number of columns in the datafile.
rows (optional) either a scalar specifying the first row to read, or a 2-element vector specifying the range of rows (inclusive) to read. If this argument is omitted, READFILE reads in every row of the file.
cols (optional) either a scalar specifying the first column to read from the file or a 2-element vector specifying the range of columns (inclusive) to read from the file. If this argument is omitted, READFILE reads in every column of the entire datafile.
emptyfill (optional) tells Mathcad what value to substitute for missing entries. NaN is the default.
Notes:
Behavior of this function is unpredictable if you have not saved the worksheet which calls it at least once, as path information for a file is uncertain until the file is saved in a particular location.