changing the name of the csv files but getting errors
Show older comments
Hi, I am basically using command below to change the name of the bunch of the files!
movefile('oldname.csv','newname.csv')
I tried on one file as shown below and it works
%movefile('vel.0.csv','vel0.csv')......basically I am using one of the post processing software which is exporting files in decimals and matlab is giving me an error while reading the files.... so I want to change the name or remove the points. I tried to loop it but I am getting an error as you can see below I have files from vel.0.csv to vel.201.csv all i want to remove an extra decimal point from them so ti should be like vel0.csv t0 vel201.csv
Code tried so far:
% Get all files in the current folder clear all;
files = dir(fullfile('C:','Users','muhammad','Desktop','Velocity','*.csv'));
% Loop through each
for ii = 1:length(files)
movefile(vel.(ii).csv, vel(ii).csv'));
end
Error:
Error: File: renameFiles.m Line: 9 Column: 47
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for
mismatched delimiters.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!