Need to copy files with same name and rename with foldername

A swapping-ground for Regular Expression syntax

Need to copy files with same name and rename with foldername

Postby genkisan » Thu Sep 04, 2014 4:55 pm

Hi all! Tried to search for this but didn't find an answer.

I have a challenge - There are a number of files on a network drive in different folders under the same root folder, which have all the same name 'common.tds'.

Now all these files are in directories with the same name 'scripts' (under different branches), and all of those directories are in directories with 'project' -identifiers like 'PROJECTABC' or 'PROJECTDEF'.


My challenge is -- copy all the 'common.tds' -files from these different directory branches into my local drive and at the same time rename them to 'PROJECTABC_common.tds', 'PROJECTDEF_common.tds' and so forth. So rename files copied _not_ with the immediate parent folder, but the one above.

Thanks in advance for any help!
genkisan
 
Posts: 2
Joined: Thu Sep 04, 2014 4:21 pm

Re: Need to copy files with same name and rename with foldername

Postby genkisan » Thu Sep 04, 2014 5:01 pm

Visual 'representation':

REMOTE----->----->
Root
----- ProjectABC
----------Scripts
----------------Common.tds
----- ProjectDEF
----------Scripts
----------------Common.tds
----- ProjectGHI
----------Scripts
----------------Common.tds

LOCAL----->----->
ProjectABC_Common.tds
ProjectDEF_Common.tds
ProjectGHI_Common.tds
genkisan
 
Posts: 2
Joined: Thu Sep 04, 2014 4:21 pm


Return to Regular Expressions