Why does my readtable fail to read .csv files (but reads .xlsx files)?
4 次查看(过去 30 天)
显示 更早的评论
I have the files "eraseme.csv" and "eraseme.xlsx" in the current directory (the csv one is attached; the other is identical, except for the extension). When I try to read them, xlsx works but csv doesn't:
>> readtable("eraseme.xlsx")
ans =
2×2 table
abc def
___ ___
1 2
3 4
>> readtable("eraseme.csv")
Error using readtable (line 197) Too many input arguments.
Note: readtable detected the following parameters: 'Delimiter', ',', 'HeaderLines', , 'ReadVariableNames', true, 'Format', ''
I have obtained the same error on multiple other xlsx and csv files as well. I have tried it on two different computers, one running MATLAB 2018a (error message above) and one running 2017b, and I get the same error, except that the latter gives me a slightly different error message (two small differences):
>> readtable("eraseme.csv")
Error using readtable (line 198) Too many input arguments.
Note: readtable detected the following parameters: 'Delimiter', ',', 'HeaderLines', 0, 'ReadVariableNames', true, 'Format', ''
One month ago, I was able to use readtable on csv files just fine on all of my computers. The above problem appeared after I installed MATLAB on a new computer and changed my Dropbox account from a personal one to a company one (all of my computers use the same Dropbox account). There were some path complications associated with Dropbox but they appear to have been solved... or not.
Please advise. I have many older programs using readtable that I can no longer run...
3 个评论
dpb
2018-4-29
>> type eraseme.csv
abc,def
1,2
3,4
>> t=readtable('eraseme.csv')
t =
2×2 table
abc def
___ ___
1 2
3 4
>> readtable('eraseme.xlsx')
ans =
2×2 table
abc def
___ ___
1 2
3 4
>>
>> ver
MATLAB Version: 9.3.0.713579 (R2017b)
...
Doesn't seem to be a Version thing; R2017b reads the file just fine here. Something to do with a local configuration issue, maybe?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!