rename photos in a specific folder
이전 댓글 표시
Hello everybody,
I have a set of photos in a specific folder. Let say they start from Image00000_IR1 to Image00100_IR1. What I want is to rename these photos, so they will become Image00101_IR1 to Image00199_IR1. Is there a way that we could do that in MATLAB?
Thanks in advance.
댓글 수: 3
Image Analyst
2021년 1월 2일
Is it only the 3rd zero that needs to be changed to 1? Like
outputFileName = inputFileName;
outputFileName(8) = '1';
movefile(inputFileName, outputFileName);
or does it need to be more general than that, like add a hundred to whatever number is there?
Mohanned Al Gharawi
2021년 1월 2일
편집: Stephen23
2021년 1월 2일
Stephen23
2021년 1월 2일
"I dont know where is my error?"
The orignal name and the new name are exactly the same. It appears that you might want to change the file extension, but your code just uses exactly the same file extension.
The robust and recommended way to split the filename and file extension is to use fileparts, rather than messing about with indexing like this code does.
답변 (1개)
Image Analyst
2021년 1월 2일
0 개 추천
Why can't you just essentially follow the way I did it in your almost identical question:
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!