Change file name to something else?

1 visualizzazione (ultimi 30 giorni)
Sameer Dave
Sameer Dave il 13 Nov 2019
Commentato: Walter Roberson il 13 Nov 2019
I have several files in a folder that can be openend using notepad++ which has a number/characters in it. I would like to know if there is a way to look for those numbers/characters and add them to the name of the file.
e.g. File name: AB_123_CD_4567 ------> change this name to "AB_123_CD_4567_AB123" where AB123 was found within the file "AB_123_CD_4567".
  3 Commenti
Sameer Dave
Sameer Dave il 13 Nov 2019
I was more looking forward to the basic codes that would be used to carry all the steps out.
Walter Roberson
Walter Roberson il 13 Nov 2019
Reading the file: it is common that for cases like these, fileread() can be used. After that, regexp() is often useful for pulling out the part of the file you need. Then compute the new file name, and movefile()

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by