filenames - Batch Change File Names in Matlab -
I have 200 JPEG images which are counted from 1200 to 1399. How do I change their names? This is a problem that can be resolved more efficiently in bish or other shell scripting languages. Perhaps, this can be solved only through a single shell, Still, matlab can do a job too. Consider this. 1200.jpg -
1400.jpg to
1.jpg -
200.jpg , While keeping the original order of image names?
Find .
list = dir ('. / Stack * .png'); % # Believes that file names like stack1200.jpg offset = -1200; #% Offset amount for number idx = 1: Length (list)% # We name = list of each file name (idx) .name; Number = sscanf (name, 'stack% f.png', 1); % # We transmit the number (name, ['stack' num2str (number + offset) '.png']); % # We rename the file. End
Comments
Post a Comment