Adding a string in front of every variable in a table
3 ビュー (過去 30 日間)
古いコメントを表示
I was looking to make a script that added a string in front of every variable in my table.
For example, I want to add "Table_" in front of every variable in the table I've attached to this post.
0 件のコメント
採用された回答
Voss
2022 年 9 月 20 日
% read the table
t = readtable('Ztable.xlsx','VariableNamingRule','preserve');
% modify the variable names
t.Properties.VariableNames = strcat('Table_',t.Properties.VariableNames);
% save the table
writetable(t,'Ztable_modified.xlsx')
2 件のコメント
Eric Sofen
2022 年 9 月 21 日
t.Properties.VariableNames = "Table_" + t.Properties.VariableNames;
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!