How can I read data from a datastore without knowing the exact data type?
Show older comments
I am working on a data cleaning project. The data set has a column, which should be filled with float numbers while there are some chars or strings or missing values. The examples are:
ID Date TimeSeries1
A 20170901 1.2
A 20170902 1.3
A 20170903 NaN
A 20170904 Char
A 20170905 String
A 20170906 1.7
My approach is that I read one row and test if the TimeSeries1 of that row is float or not. Then I pick it out. I load this .csv file as a data store and I try to read one row per time. But the Read function of datastore requires to specify the data type that I read, such as {"%q" "%d" "%f"}. So when it reads a row with wrong value, the program exits and I cannot make further operations on it.
So how can I read data from a datastore without knowing the exact data type?
Accepted Answer
More Answers (0)
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!