How to remove all weird column names from a table and replace them (with numbers or alphabet letters)?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Andrew Sol
el 24 de Oct. de 2024
Comentada: Andrew Sol
el 24 de Oct. de 2024
I have a file in the .csv format.
When I transfer it to Matlab, the column names turn into some kind of gibberish.
In fact, I need to remove all these names and replace them with anything (numbers or letters of the alphabet in ascending order).
The problem is, how to remove all the column names at once without manually entering them in the removevars command?
0 comentarios
Respuesta aceptada
KSSV
el 24 de Oct. de 2024
Editada: KSSV
el 24 de Oct. de 2024
T = readtable(myfile) ;
T.Properties.VariableNames = {'1','2','3','4','5','6','7','8'} ;
NOTE: The column names on the right should be of same size of number of columns.
Also give a try on:
T = readtable(myfile,'VariableNamingRule','preserve')
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!