Borrar filtros
Borrar filtros

Text to datastore error

7 visualizaciones (últimos 30 días)
HoboHarry
HoboHarry el 23 de Sept. de 2018
Editada: Al Dente el 30 de Sept. de 2019
I'm getting the following error when using text to datastore
Error using matlab.io.datastore.TabularTextDatastore/set.SelectedVariableNames (line 619) SelectedVariableNames must be a unique subset of VariableNames.
Was hoping omeone could explain what this could possibly mean? I've gone through all the data and it is there in the correct format, all the headings appear to be spelt the same, and i'm pretty confident my variable names are correct. Any light on the potential would be good
  2 comentarios
Nicole Peltier
Nicole Peltier el 23 de Sept. de 2018
Without seeing the data, my guess is that you're trying to reuse a variable name within a table. Could you share your table so we can get a better idea of what's happening?
Al Dente
Al Dente el 2 de Oct. de 2018
@HoboHarry do you have repeating variable names?

Iniciar sesión para comentar.

Respuestas (1)

GioPapas81
GioPapas81 el 30 de Sept. de 2019
Hi,
I am also getting the same error when I do the following:
ds.SelectedVariableNames = {'eid','20201-2.0'};
Error using matlab.io.datastore.TabularTextDatastore/set.SelectedVariableNames (line 619)
SelectedVariableNames must be a unique subset of VariableNames.
I don't have other variable with that name, but the same name repeats in the same column across multiple rows.
I am attaching my .csv file.
Any help would be great.
Thank you.
  1 comentario
Al Dente
Al Dente el 30 de Sept. de 2019
Editada: Al Dente el 30 de Sept. de 2019
ds.SelectedVariableNames = {'eid','20201-2.0'};
in this example '20201-2.0' is not a valid variable name:
"Starting in R2019b, variable names and row names can include any characters, including spaces and non-ASCII characters. Also, they can start with any characters, not just letters. Variable and row names do not have to be valid MATLAB identifiers (as determined by the isvarname function). To preserve these variable names and row names, set PreserveVariableNames to true."
if you don't have 2019b then this is probably the problem, however if you do then: "To support invalid MATLAB identifiers as variable names, such as varible names containing spaces and non-ASCII characters, set the PreserveVariableNames parameter to true."

Iniciar sesión para comentar.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by