New version of readtable does not load .csv file.
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 3 Fév 2022
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
le 3 Fév 2022
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
le 3 Fév 2022
Modifié(e) : Raymond Ng
le 9 Fév 2022
Walter Roberson
le 9 Fév 2022
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
le 9 Fév 2022
Walter Roberson
le 9 Fév 2022
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
le 9 Fév 2022
Raymond Ng
le 30 Mar 2022
Modifié(e) : Raymond Ng
le 30 Mar 2022
Réponses (0)
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!