How to change the name of the images from frame1.jpg , frame2. jpg to image1.jpg etc etc
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
muhammad choudhry
il 29 Set 2020
Commentato: Ameer Hamza
il 30 Set 2020
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 Commenti
Risposta accettata
Ameer Hamza
il 29 Set 2020
Modificato: Ameer Hamza
il 30 Set 2020
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 Commenti
Ameer Hamza
il 30 Set 2020
Sorry, there was a mistake. Check the updated code. Also, does the old file names should start with the frame, all lower case.
Più risposte (1)
KSSV
il 29 Set 2020
To read the files in order use: https://in.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!