- read the file
- find the text to add to the file name (if any)
- rename the file
Change file name to something else?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
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()
Respuestas (0)
Ver también
Categorías
Más información sobre Standard File Formats en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!