change_fnames
Change the names of files in a directory.
Syntax
n=change_fnames(recdir,prefix,newprefix) %Matlab & Octave #R to do
Description
Change the names of files in a directory. This is useful for changing the names of a set of files from a tag deployment to a different format. Only the first part of the name matching the prefix is changed - any trailing letters or numbers are kept. Careful: things can go very wrong when messing with valuable data files. Always do a check first on some dummy files. There may also be better ways to do re-naming operations through your operating system.
Inputs
Input var | Description | Default |
---|---|---|
recdir | is a string containing the full or relative (to the current working directory) pathname of the directory where the files are stored. | N/A |
prefix | is a string containing the part of the file name to be changed. | N/A |
newprefix | is a string containing the replacement. | N/A |
Outputs
Output var | Description | Units |
---|---|---|
n | is the number of files that were re-named. | N/A |
Example
Matlab & Octave
change_fnames('/tag/data/zc17','zc17_173a','zc17_172a') % renames all files in /tag/data/zc17 called zc17_173a* to zc17_172a*.
R
# to do # renames all files in /tag/data/zc17 called zc17_173a* to zc17_172a*.
About
bugs@animaltags.org Last modified: 12 July 2017