How to replace spaces with underscores in all variable names of a table?
48 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
JMSE
el 3 de Ag. de 2021
Comentada: JMSE
el 3 de Ag. de 2021
Hi,
I am searching for a solution to replace all ' ' (spaces) with underscores '_' in a range of variable names of a table. As the tables vary and the variable names change likewise, I need to find a more universal solution than changing the header names with
X.Properties.VariableNames = {'..' '...'}
I have tried regexprep and strrep, but couldn't find a way to make it work.
Thank you very much in advance!
Judith
0 comentarios
Respuesta aceptada
Walter Roberson
el 3 de Ag. de 2021
X.Properties.VariableNames = regexprep(X.Properties.VariableNames, ' ', '_'))
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!