This directory contains some simple Matlab functions for recursive operations on files (wildcards on subdirectories allowed), and automatic renaming and renumbering for series of files. This may be useful for handling a large number of files:
cdw - Change directory (like CD), allowing wildcard (*).
lsw - List directory (like LS), allowing wildcard (*).
rdir - Recursive list directory.
rdelete - Delete files recursively.
rrmdir - Delete directories recursively.
renamefile - Rename a series of files.
renumberfile - Re-number the indices of a series of files
getfilenum - Get the index of a series of files.
expandstr - Expand indexed strings (used by the other functions)
Examples:
CDW mydir*/dir*12 works as CD, but wildcards (*) are allowed
F = RDIR('set*/DSC*.*') returns all the files matching DSC*.* in all
the directories matching set*.
RENAMEFILE('DSC*.JPG','DSC','myphoto') renames the files 'DSC00001.JPG',
'DSC00002.JPG',... as 'myphoto00001.JPG','myphoto00002.JPG',...
RENUMBERFILE('DSC*.JPG','DSC') renumbers the *.JPG files as
'DSC00001.JPG'...'DSC00100.JPG'.
N = GETFILENUM('*.JPG','DSC') returns the indices of JPG-files.
See the help for each function for more examples. |