How to change the name of the images from frame1.jpg , frame2. jpg to image1.jpg etc etc
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I would like to change the name of 100 images from frame...jpg to image 1.jpg , image2.jpg etc etc.
can you guys help?
Regards,
M Choudhry.
0 件のコメント
採用された回答
Ameer Hamza
2020 年 9 月 29 日
編集済み: Ameer Hamza
2020 年 9 月 30 日
Something like this
files = dir('*.jpg');
for i = 1:numel(files)
old_name = files(i).name;
new_name = strrep(old_name, 'frame', 'image');
movefile(old_name, new_name)
end
2 件のコメント
Ameer Hamza
2020 年 9 月 30 日
Sorry, there was a mistake. Check the updated code. Also, does the old file names should start with the frame, all lower case.
その他の回答 (1 件)
KSSV
2020 年 9 月 29 日
To read the files in order use: https://in.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!