Effacer les filtres
Effacer les filtres

Rename a directory in-place (without moving its content)

1 vue (au cours des 30 derniers jours)
Maad Ebrahim
Maad Ebrahim le 25 Juil 2018
Commenté : Maad Ebrahim le 25 Juil 2018
Using {movefile} to rename a directory actually moves all the contents to a new folder and then delete the previous one. And if there are huge number of files in the directory, that is time consuming. Hence, is there a way to rename the directory in-place, without actually moving the sub-files and sub-directories.
Thanks for your help.
Yours, Maad

Réponses (1)

Krithika A
Krithika A le 25 Juil 2018
What do you mean by rename the directory? You mean the folder that has all your files? If that's it, you just need to rename the folder on your drive.
  3 commentaires
Krithika A
Krithika A le 25 Juil 2018
Oh, you want to rename all the files in the directory. Is that correct? If so, what types of files are they? It would be different for each file type. It also depends on what the file names are currently and what you want to rename them to.
Maad Ebrahim
Maad Ebrahim le 25 Juil 2018
No, not that. I want to rename the folder that contains those files. And I have many folders to be renamed as they all have many files as well.
oldFolderName <----rename this programmatically
...folder_1
......file_1
......file_n
...folder_m
......file_1
......file_n

Connectez-vous pour commenter.

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by