Adding a string in front of every variable in a table
2 views (last 30 days)
Show older comments
BA on 20 Sep 2022
Commented: Eric Sofen on 21 Sep 2022
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.
Voss on 20 Sep 2022
% read the table
t = readtable('Ztable.xlsx','VariableNamingRule','preserve');
% modify the variable names
t.Properties.VariableNames = strcat('Table_',t.Properties.VariableNames);
% save the table
Eric Sofen on 21 Sep 2022
More Answers (0)
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!