Reading data from csv with non uniform formatting
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to read data from a cvs file (sample attached) with uneven formatting where there are a few sentences and lines with missing data points. I have been reading the file and then getting the row number for each time the column with is different to extract the data. I am trying to read ( and remove) the sentences and also remove the partially complete rows and creating one array from the remaining data. Is there any better way of doing this withouth having to check which row is incomplete? Any suggestions would be very helpful.
Thank you
采纳的回答
Cris LaPierre
2023-4-24
I would use readtable with the settings to 'omitrow' when data is missing.
T = readtable('sample.csv','MissingRule','omitrow')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!