Change file name to something else?

1 visualización (últimos 30 días)
Sameer Dave
Sameer Dave el 13 de Nov. de 2019
Comentada: Walter Roberson el 13 de Nov. de 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 comentarios
Sameer Dave
Sameer Dave el 13 de Nov. de 2019
I was more looking forward to the basic codes that would be used to carry all the steps out.
Walter Roberson
Walter Roberson el 13 de Nov. de 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()

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Standard File Formats en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by