File 'Data_01.csv' already exists. I want to rename the existing file to 'Data_02.csv' when I try to save a new file with the same name. How do I do it?
4 views (last 30 days)
Show older comments
Dear peeps,
I am recording sensor data from a third party software through which I can save the log file as .csv in a folder path. The problem here is the log file name does not get incremented but gets overwritten everytime I record a new sample. I need to rename it over and over again when I record a new sample. It is really exhausting because I would have to take hundreds of samples sometimes thousands. So I have planned to run a matlab script in the background- to rename the existing file to avoid getting overwritten by the new data -even before I start recording the data from the third party software.
Please help me with how I can change the existing log file name (the first saved file) so that it does not get overwritten. Suppose I start saving with 'Data_01.csv' in the folder path of the third party software, hit record the next time, the existing 'Data_01.csv' in the path has to be renamed as 'Data_02.csv' and so on. Suppose if I have to record 30 samples, and not have to change the name in the folder path of the third party software over and over agin, how do i do it?
Thanks in advance.
Best Regards,
Nikhilesh. K
Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!