changing names of files

28 ビュー (過去 30 日間)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2015 年 8 月 3 日
I have 100 file name wflux_23.34_86.45,wflux_12.34_76.34 like that and I have to change the name data_23.34_86.45,data_12.34_76.34 etc. How can I do it in matlab.

回答 (1 件)

David Sanchez
David Sanchez 2015 年 8 月 3 日
% Renaming a File in the Current Folder
% In the current folder, rename oldname.m to newname.m:
% movefile('oldname.m','newname.m')
my_files = dir ('*.pdf');
for k=1:numel(my_files)
newname = strcat('data', my_files(k).name(6:end));
movefile(my_files(k).name, newname);
end
  1 件のコメント
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2015 年 8 月 4 日
Thanks.It works

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by