How to filter out missing data from a text file with readtable()? Different data types in the same column.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to use readtable() to read this textfile I have, however the textfile has one column that has different types of data within it. The database I got the data from is supposed to give me a number for every hour of every day, but if there was no data recorded at a certain time insted of a floating point number it will have a char "M".
What is the best way for me to import this text file using readtable()? I need the information from the second and third columns, but I do not want the rows that have M as a value for the third column.
Here is an example of my data:
MKE,2008-07-08 05:52,4.83
MKE,2008-07-08 06:52,0.51
MKE,2008-07-08 07:52,M
MKE,2008-07-08 08:52,M
0 Kommentare
Antworten (1)
dpb
am 28 Mai 2019
Use the 'TreatAsEmpty' named argument to read the M lines as empty and will return NaN. Then just delete the rows that return isnan() == T.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!