New version of readtable does not load .csv file.
이전 댓글 표시
I just upgraded from 2019a to 2021b and I cannot upload a .csv file that used to have no problem loading into Matlab. Readtable or similar end result would be preferred since I have many codes that use readtable. The .csv is an output from elsewhere so modifying it would not be feasible since it would require me to modify too many .csv files for current codes to work.
My current error is :
Error using readtable (line 498)
Invalid default value for property 'eol_' in class 'matlab.io.internal.shared.TextInputs':
Too many output arguments.
Error in Compare_node2DAS_PSD (line 11)
T = readtable('20210501_META_DASnode_enid_B.csv');
T=readtable('20210501_META_DASnode_enid_B.csv');
댓글 수: 8
Walter Roberson
2022년 2월 3일
When I try that file in R2021b I get
Warning: The DATETIME data was created using format 'MM/dd/uuuu hh:mm:ss aa' but also matched 'dd/MM/uuuu hh:mm:ss aa'.
To avoid ambiguity, supply a datetime format using SETVAROPTS, e.g.
opts = setvaropts(opts,varname,'InputFormat','MM/dd/uuuu hh:mm:ss aa');
> In matlab.io.internal.readers/TextDataReader/read (line 102)
In matlab.io.internal.functions/ReadTableWithImportOptionsText/executeImpl (line 61)
In matlab.io.internal.functions/ReadTableWithImportOptions/executeImpl (line 25)
In matlab.io.internal.functions/ReadTableWithImportOptionsText/execute (line 66)
In matlab.io.internal.functions/ReadTableWithImportOptions/execute (line 45)
In matlab.io.internal.functions/ReadTable/execute (line 46)
In matlab.io.internal.functions/ExecutableFunction/validateAndExecute (line 102)
In readtable (line 495)
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the
VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
Cris LaPierre
2022년 2월 3일
I get the same warnings as Walter when using readtable to load your file in both R2019b that I do in R2021b. However, the file is successfully loaded in both versions.
Raymond Ng
2022년 2월 3일
편집: Raymond Ng
2022년 2월 9일
Walter Roberson
2022년 2월 9일
Have you added any third-party code to the matlab path? Have you added some of your own directories to the matlab path? Are you doing this test in a directory that has some matlab files, or in a directory that only has data?
The error message implies that that something is unexpectedly coming out empty, but there are enough levels involved in the code that tracking it down would probably not be simple.
Raymond Ng
2022년 2월 9일
Walter Roberson
2022년 2월 9일
as an experiment, try resetting the matlab path, and switching to a directory that only has a data file, and trying to read it. The working hypothesis is that something that is on the path is interfering, and the test for that is trying to read a file with a totally default path with no m files.
Raymond Ng
2022년 2월 9일
Raymond Ng
2022년 3월 30일
편집: Raymond Ng
2022년 3월 30일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!