preview
Preview eight rows from file using import options
Description
returns a table containing the first eight rows of data in
T = preview(filename,opts)filename, using the import options opts.
The value of the
SelectedVariableNamesproperty of the import options objectoptsselects the variables that appear in the tableT.The preview function returns a subset of the data that the
readtablefunction returns with the import options objectopts.Usually, the output of the
previewfunction contains eight rows of data. However, in some instances the number of rows differs depending on property values defined in the import options objectopts. For more details see, Tips.
Examples
Input Arguments
Algorithms
The
previewfunction returns fewer than eight rows in these cases:When the file contains fewer than eight rows of data.
When the
DataLinesor theDataRangeproperties of theoptsobject specify less than eight rows.When a combination of the properties of the
optsobject result in less than eight rows of data. For example,previewreturns less than eight rows when the value of theEmptyLineRule,ImportErrorRuleor theMissingRuleof theoptsobject causes the importing function to omit data.
When the
DataLinesor theDataRangeproperty of theoptsobject specifies multiple row ranges and the first row range spans fewer than eight rows, thenpreviewreturns the rows from the first row range followed by rows from successive row ranges until it reaches a total of eight rows.
Version History
Introduced in R2018a
See Also
detectImportOptions | readtable | getvaropts | setvaropts | setvartype