Making a new .txt or .xlsx file automatically

版本 1.0.0.1 (2.2 KB) 作者: Joseph Wilson
This function auto generates a new file for data collection to prevent the overwriting of data without the need for manual file name changes
31.0 次下载
更新时间 2019/7/3

查看许可证

This function auto generates a new file for data collection
The baseFileName can be changed to whatever you would like your new .txt
file name to be. Originally it is 'data'.

This function returns 'data1.txt' to your main script which can then be opened and written in using fopen and fprintf provided data1.txt does not already exist.
If data#.txt exists this function generates data(#+n).txt until a nonexisting file name is found. i.e. data20.txt if data1.txt-data19.txt already exists in the current folder.

This is useful for continuous data collection without having to rename the .txt file manually prior to each run to avoid overwriting data.
This function can also generate new .xlsx .xls .csv files by changing the value of extension_ to the desired extension

引用格式

Joseph Wilson (2024). Making a new .txt or .xlsx file automatically (https://www.mathworks.com/matlabcentral/fileexchange/72021-making-a-new-txt-or-xlsx-file-automatically), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Low-Level File I/O 的更多信息

Community Treasure Hunt

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

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

Updated to receive varying inputs from users
Updated to site other FEX files that do this in a different manner.

1.0.0