Change the folder names from one digit to 2 digit numbers
5 ビュー (過去 30 日間)
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 2016 年 4 月 26 日
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.