How to replace spaces with underscores in all variable names of a table?
조회 수: 48 (최근 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!