Change the folder names from one digit to 2 digit numbers
8 views (last 30 days)
Butterflyfish on 26 Apr 2016
I have a folder 'data' full of folders which are named like this:
I would like to rename the folders with one digit (foldername1- foldername9) with two digits, like that:
As I have lots of those 'data' folders I would like to automate it. I tried without success so far... Could anyone please help me?
Alessandro Masullo on 26 Apr 2016
You can use dir, sscanf, sprintf and movefile.
Use dir to get the list of the folders.
Use scanf to get the number of the folder:
Use sprintf to write the new folder name
Use movefile to rename your folder.