How to rename multiple file in a folder.

조회 수: 1 (최근 30일)
Fiona
Fiona 2016년 1월 21일
답변: jonathan 2017년 10월 7일
I need to alter a heap of file names in a folder.
For instance:
2015_SUBJECT1^TEST_Upper_tag_CLEAR_30_1.PAR
2014_SUBJECT2^TEST_Lower_tag_1_OPEN_50_1.PAR
I need to get rid of the first 5 digits, the last 2 digits and all references of '^TEST', 'CLEAR' and 'OPEN'.
Note that in the folder there are two types of files (i.e. .PAR and .REC) with the same names that all need to be changed.
Help is much appreciated!

답변 (2개)

Walter Roberson
Walter Roberson 2016년 1월 22일
Is it correct that for '2015_SUBJECT1^TEST_Upper_tag_CLEAR_30_1.PAR' you would want the result '_SUBJECT^_Upper_tag__3_.PAR' ?
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 2월 22일
That looks more like you want to get rid of the first 4 digits than the first 5 ? The fifth digit would be the "1" after "SUBJECT"
Fiona
Fiona 2016년 3월 6일
My mistake... I should not have used to word digit. Rather I wanted to get rid of the first 5 characters (i.e. the '2015_' so it would start SUBJECT1). Thanks again Walter.

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


jonathan
jonathan 2017년 10월 7일
This is a great article. You can use this technique. Beside this- I have a software for bulk rename. My software works with all platform. For checking my software go to google.com and type- BatchRenameFiles Tool. Check the first result.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by