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!