Replace all the spaces “ “ with “_” in Folder names including sub folder names and all the files in those folders
using VBA Code
Task 1
I need to replace all the spaces with “_” in folders names selected and their sub folders
C:\New Folder 1
C:\New Folder 2
C:\New Folder 2\Motor Vehicles
C:\New Folder 2\Motor Cycles
C:\New Folder3
C:\New Folder4
After rename the folder names must be
C:\New_Folder_1
C:\New_Folder_2
C:\New_Folder_2\Motor_Vehicles
C:\New_Folder_2\Motor_Cycles
C:\New_Folder3
C:\New_Folder4
Task 2
I need to replace all the spaces with “_” in file names in all the selected folder and their sub folders
C:\New_Folder_1\Data [login to view URL]
C:\New_Folder_1\Test [login to view URL]
C:\New_Folder_2\Motor_Vehicles\File [login to view URL]
C:\New_Folder_2\Motor_Vehicles\File [login to view URL]
C:\New_Folder_2\Motor_Vehicles\File [login to view URL]
C:\New_Folder_2\Motor_Cycles\Test File [login to view URL]
C:\New_Folder_2\Motor_Cycles\Test 2 File [login to view URL]
C:\New_Folder_2\Motor_Cycles\Resulst File [login to view URL]
After rename the File names must be
C:\New_Folder_1\[login to view URL]
C:\New_Folder_1\[login to view URL]
C:\New_Folder_2\Motor_Vehicles\[login to view URL]
C:\New_Folder_2\Motor_Vehicles\[login to view URL]
C:\New_Folder_2\Motor_Vehicles\[login to view URL]
C:\New_Folder_2\Motor_Cycles\[login to view URL]
C:\New_Folder_2\Motor_Cycles\[login to view URL]
C:\New_Folder_2\Motor_Cycles\[login to view URL]
Process
The Active folder for renaming is to be obtained from the .ini file C:\Ace7\[login to view URL]
If the specified folder is C:\MyFolder the process must start renaming all files, folders, sub folder and all the files in the sub folders
Once done message to screen if task was completed successfully.
HI,
I can do it using VBA module that can be imported into Excel, Access or any office application.
In order to traverse the sub folder and sub-sub folders I ll use a recursive sub.
Regards,
Hussien Sharaf
$25 USD trong 1 ngày
5,0 (12 nhận xét)
6,4
6,4
5 freelancer chào giá trung bình $22 USD cho công việc này