MATLAB: Header row causes issues in readtable

headersMATLABreadtable

Hello I am stumped
I have a pile of files like the attached. They are tab delimited even though they are .csv files.
If I remove the header I can use readtable just fine but I can't figure out how to import the data using readTable without manually deleating the header from each file…
The header and data has the same number of columns.
Otherwise I can't figure out a reasonable way to import them.
To be honest, I don't care about even having the right variable names but I can't work around it.

Best Answer

T = readtable('testfile.csv', 'ReadVariableNames', false, 'HeaderLines', 1);
Or, R2019b or later,
T = readtable('testfile.csv', 'PreserveVariableNames', true);
Note that the code guesses 'MM/dd/uuuu HH:mm' format instead of 'dd/MM/uuuu HH:mm' . If there were enough input in a column that it could figure it out then it would not have to guess. You can force a particular interpretation by using detectImportOptions and using setvaroptions() of 'InputFormat' and then passing the options to readtable()