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
SelectedVariableNames
property of the import options objectopts
selects the variables that appear in the tableT
.The preview function returns a subset of the data that the
readtable
function returns with the import options objectopts
.Usually, the output of the
preview
function 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
preview
function returns fewer than eight rows in these cases:When the file contains fewer than eight rows of data.
When the
DataLines
or theDataRange
properties of theopts
object specify less than eight rows.When a combination of the properties of the
opts
object result in less than eight rows of data. For example,preview
returns less than eight rows when the value of theEmptyLineRule
,ImportErrorRule
or theMissingRule
of theopts
object causes the importing function to omit data.
When the
DataLines
or theDataRange
property of theopts
object specifies multiple row ranges and the first row range spans fewer than eight rows, thenpreview
returns 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