readtable function inserting NaN rows

clear
clc
datatest = readtable('TestData_readtable.csv','Headerlines',4,'ReadVariableNames',true);
'readtable' function is getting confused about the '3-0382' and inserting addtional rows into the imported table
I tried to use 'Range' but I cannot get it to work and this would be a solution.
The data sets I have do change in column count and poitision and therfore I would also be interested if there are any other ways of dealing with this pesky hyphon.
I have tried 'rmmissing' on individual columns but this creates problems in other areas of my code and doesn't deal witht he issue at the source.
I have attached an exampel data set.
I would apreciate any support on this!

 采纳的回答

clear
clc
datatest = readtable('TestData_readtable.csv','Headerlines',4,'ReadVariableNames',true,'CommentStyle',{'-'});
As always in formalising the question sometime the answer emerges.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息

产品

版本

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by