auto_rename

版本 1.0 (3.9 KB) 作者: Adam Danz
Automatically rename any file if the file name already exists in the directory chosen.
210.0 次下载
更新时间 2015/4/12

查看许可证

AUTO_RENAME.m is helpful when saving multiple files (.mat, .fig, .m, or any extension) that should be tagged with a number to avoid duplicate files. Enter the full path to the file you're saving and enter a string describing how the numerical tag should appear. The output is a full path to the unique file name.
Example:
auto_rename ('C:\Users\user\Documents\MATLAB\mydata.mat', ' vs 0')
= 'C:\Users\user\Documents\MATLAB\mydata vs 2.mat'

This will search the dir for this file name and will append it with ' vs x' where x is the first integer after 1 that will make the file name unique. The integer will be placed at the location of '0' within the input string (in this case, ' vs 0').

See help file for more examples.

引用格式

Adam Danz (2024). auto_rename (https://www.mathworks.com/matlabcentral/fileexchange/50484-auto_rename), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2014a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Standard File Formats 的更多信息
致谢

启发作品: Next Available Filename

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0