detectImportOptions
Create import options based on file content.
📝 Syntax
options = detectImportOptions(filename)
📥 Input argument
filename - a string: filename source.
📤 Output argument
options - DelimitedTextImportOptions object.
📄 Description
options = detectImportOptions(filename) identifies a table in a file and returns an importoptions object.
You can customize this object and use it withreadtable, readcell orreadmatrix to control how Nelson imports data as a table, cell array, or matrix.
The type of the returned options object depends on the file's extension.
Properties:
Delimiter: Field delimiter characters. example: {','}
LineEnding: End-of-line characters. example: {'\r\n'}
CommentStyle: Style of comments. example: {'#'}
EmptyLineRule: Procedure to handle empty lines. example: 'skip'
VariableNamesLine: Variable names location. example: 1
VariableNames: Variable names. example: {'Names' 'Age' 'Height' 'Weight'}
RowNamesColumn: Row names location. example: 0
DataLines: Data location, [l1 l2] Indicate the range of lines containing the data. l1 refers to the first line with data, while l2 refers to the last line. example: [2 Inf]
💡 Example
🔗 See also
readcell, readtable, readmatrix.
🕔 History
1.10.0
initial version
Last updated
Was this helpful?