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!

 採用された回答

Ryan Byrne
Ryan Byrne 2020 年 2 月 6 日

0 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

リリース

R2017a

質問済み:

2020 年 2 月 6 日

回答済み:

2020 年 2 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by