If you specify SelectedFormats, you must also specify SelectedVariableNames
If you specify SelectedFormats, you must also specify SelectedVariableNames
If you specify SelectedFormats, you must also specify SelectedVariableNames
Re: If you specify SelectedFormats, you must also specify SelectedVariableNames
Solution:
spreadsheetDatastore
Datastore for spreadsheet filesexpand
Description
Use a SpreadsheetDatastore object to manage large collections of spreadsheet files where the collection does not necessarily fit in memory. You can create a SpreadsheetDatastore object using the spreadsheetDatastore function, specify its properties, and then import the data using object functions.
Properties for preview, read, readall Table
SelectedVariableNames — Variables to read
character vector | cell array of character vectors | string scalar | string array
Variables to read from the file, specified as a character vector, cell array of character vectors, string scalar, or string array. Each character vector or string contains the name of one variable. You can specify the variable names in any order. You can specify SelectedVariableNames with a character vector or string scalar, however spreadsheetDatastore automatically converts it to a cell array of character vectors or a string array.
To support invalid MATLAB identifiers as variable names, such as variable names containing spaces and non-ASCII characters, set the value of VariableNamingRule parameter to 'preserve'.
Example: {'Var3','Var7','Var4'}
Data Types: char | cell | string
SelectedVariableTypes — Selected variable types
'double' | 'char' | 'string' | 'categorical' | 'datetime'
Selected variable types, specified as 'double', 'char', 'string', 'categorical', or 'datetime', which indicates the type of each selected variable when reading the data. The list of variable types corresponds with the variables in SelectedVariableNames. Types double, char, and datetime can be automatically detected from the data. You can specify SelectedVariableTypes as a character vector or string scalar, however it is automatically converted to a cell array of character vectors or string array.
Example: {'double','datetime'}
Data Types: char | cell | string
For more information,
https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.spreadsheetdatastore.html
spreadsheetDatastore
Datastore for spreadsheet filesexpand
Description
Use a SpreadsheetDatastore object to manage large collections of spreadsheet files where the collection does not necessarily fit in memory. You can create a SpreadsheetDatastore object using the spreadsheetDatastore function, specify its properties, and then import the data using object functions.
Properties for preview, read, readall Table
SelectedVariableNames — Variables to read
character vector | cell array of character vectors | string scalar | string array
Variables to read from the file, specified as a character vector, cell array of character vectors, string scalar, or string array. Each character vector or string contains the name of one variable. You can specify the variable names in any order. You can specify SelectedVariableNames with a character vector or string scalar, however spreadsheetDatastore automatically converts it to a cell array of character vectors or a string array.
To support invalid MATLAB identifiers as variable names, such as variable names containing spaces and non-ASCII characters, set the value of VariableNamingRule parameter to 'preserve'.
Example: {'Var3','Var7','Var4'}
Data Types: char | cell | string
SelectedVariableTypes — Selected variable types
'double' | 'char' | 'string' | 'categorical' | 'datetime'
Selected variable types, specified as 'double', 'char', 'string', 'categorical', or 'datetime', which indicates the type of each selected variable when reading the data. The list of variable types corresponds with the variables in SelectedVariableNames. Types double, char, and datetime can be automatically detected from the data. You can specify SelectedVariableTypes as a character vector or string scalar, however it is automatically converted to a cell array of character vectors or string array.
Example: {'double','datetime'}
Data Types: char | cell | string
For more information,
https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.spreadsheetdatastore.html
Who is online
Users browsing this forum: No registered users and 3 guests