Why do I get an error when using the "readtable" function to import a tab-delimited file?
Show older comments
I have a system that generates tab-delimited files. If I read the file into Excel, do some formatting, and write it out to a .xlsx file, I can read the .xlsx into MATLAB quite nicely with the "readtable" function. However, if I try to use the "readtable" function on the raw tab-delimited .dat file, I get an error.
Here's the command I'm using and the error I get. in MATLAB R2016a:
>> data = readtable('myFile.dat','Delimiter','\t');
Error using readtable (line 143)
Cannot interpret data in the file 'myFile.dat'. Found 6 variable names but 5 data columns.
You may need to specify a different format string, delimiter, or number of header lines.
Is there a way to set the options so I can read this file with readtable?
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!