uiimportdata and readtable do not recognize delimited columns
2 次查看(过去 30 天)
显示 更早的评论
I have been using a data reduction routine which loaded the data using "readtable" and discarded header lines. A change in the program to record the data has changed the format of the output so that the file is now comma separated rather than tab delimited and now there are fewer header lines. I have adjusted my code to use the correct delimiter and number of header lines, but receive the following error when I attempt to load the file:
"The data in this file does not appear to be tabular, with the same number of fields in each row and in each column. You might need to specify or modify the delimiter or number of header lines."
I tried to look at the data file using "uiimportdata" but I'm only able to see the first few header lines, and only 2 columns when I select the delimited option. If "fixed width" is selected, uiimportdata does display the other data, but the file is comma delimited, so that option is not useful. Loading the file in excel works fine.
Any ideas why these Matlab functions are not able to decipher the new delimited file? I can change some options in the program used to create the raw data file, but that has not helped so far either.
0 个评论
回答(1 个)
Gitesh Nandre
2015-6-23
Let's say your file looks like this:
number,letter
88226,x
88226,y
88229,
If there is a space or newline after the comma at the end of the file, "readtable" will work. If not, you will get the error that you mentioned. This is a known issue with MATLAB. Check if that is the issue in your case.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!