folder split into parts

조회 수: 2 (최근 30일)
DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019년 1월 17일
댓글: DIMITRIOS THEODOROPOULOS 2019년 1월 18일
I have a medical folder with 2 kinds of data Prostatex0000_* and Prostatex0001_*
How can i split the original folder into 2 subfolders?
  댓글 수: 3
DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019년 1월 17일
I haven't tried anything.I just dont know how to do it...
Perhaps i must give this image to understand better
ice_screenshot_20190117-174440.png
Rik
Rik 2019년 1월 17일
OK, so how can you get a list of files inside a folder? There is 1 function that does that.
And once you have that list, what method can you use to process each file individually?
How can you move a file? How can you create a folder?
How can you detect if a file starts with Prostatex0001 or Prostatex0000?
Start with these questions. This should enable you to find the solution on your own. The most important thing you learn as a programmer is splitting up your big problem into solvable parts.

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

채택된 답변

Stephen23
Stephen23 2019년 1월 17일
편집: Stephen23 2019년 1월 17일
In two lines:
movefile('Prostatex0000_*.nii','subdir0')
movefile('Prostatex0001_*.nii','subdir1')
  댓글 수: 1
DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019년 1월 18일
Thanks it works perfectly!!!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by