How to replace spaces with underscores in all variable names of a table?
42 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2021 年 8 月 3 日
X.Properties.VariableNames = regexprep(X.Properties.VariableNames, ' ', '_'))
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!