How can I add an extension to all files in a folder?

조회 수: 5 (최근 30일)
Amanda
Amanda 2021년 1월 5일
편집: Cris LaPierre 2021년 1월 9일
How can I add an extension to all files in a folder?
The current filetype is simply "File"
For every IM001 to IM195 file, I want to add the extension .nii
I have several hundred to several thousands of "files" in each folder, and this is just one folder.
Is there a script I can try using to do this?
Thanks!!

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 1월 5일
편집: Cris LaPierre 2021년 1월 5일
Look into movefile, which will move or rename a file or folder
  댓글 수: 4
Stephen23
Stephen23 2021년 1월 5일
@Cris LaPierre: surely the overloaded string plus operation does not require the superfluous square brackets?
Cris LaPierre
Cris LaPierre 2021년 1월 5일
True, it doesn't. I'd intilially written it without the plus and using single quotes, which does, but then saw the user has R2020a so switched to plus and double quotes. Just overlooked removing the square brackets.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by