- read the file
- find the text to add to the file name (if any)
- rename the file
Change file name to something else?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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
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()
Risposte (0)
Vedere anche
Categorie
Scopri di più su Standard File Formats in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!