KeelBug Posted April 19, 2009 Posted April 19, 2009 Hey all... just wondering if anyone can nudge me in the right direction. Cutting right to the chase, I have the need to rename a whole wad of folders in the same directory. Basicly... From: BBB_BBB_-_CCCC_CCC_CCC-(AAAAAA)-Dddd-####-XX To: [AAAAAA][D] BBB BBB - CCCC CCC CCC (####) A, B & C - Both text and numerical characters, varies in length. Dddd - Just text but only interested in the first letter, varies in length. # - Always a number, 4 digits. X - Not needed, varies in length. _ - Converted to spaces. I'm currently starting to learn VBScript and know how to do a simple find and replace but not sure exactly how to go about rearrange variables.... I assume VBS is the easiest way to approach this. Any help is appreciated muchly. Cheers. Quote
stingwray Posted April 19, 2009 Posted April 19, 2009 Perl would be the easiest way to do this. Get the list of folder names, apply a regex to it, if it matches, pull the values out of it, create your new foler name and then do the renaming. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.