views:

22

answers:

2

I have a VisualStudio project with a few sub folders like Accounting, Store etc. I need to make a duplicate of the "Accounting" folder and also rename all the Class Objects in that folder. Each object in that folder is prefixed with "Accounting".

Basically I want to name the duplicate "Customer" and change all the prefix of the Class Objects to Customer..

What's the fastest way in doing this?

A: 

I'd suggest that you copy the folders using Windows Explorer and use a tool like notepad++ or TextPad to rename multiple files.

Kane
Would this be case significant? ...e.g from a to a instead of A to a. The reason is that I also have to go through the file details and also rename some data.
Saif Khan
+2  A: 

The fastest way to do this is probably the Unix command line tools. (On Windows, you can install, e.g., MSys or Cygwin to use them.) If you haven't done this, however, it will take quite a while to set this up and get familiar with them.

Here on my Windows box I would probably use a combination of TotalCommander (for file copying and batch file renaming) and VS itself (for batch identifier replacement).

I have, however, never come into the situation to do this, since, in general, I shy away from code duplication. Have you asked yourself why you're doing this and whether there's a better way? If the code duplication is so massive that it's worth the time asking us how to do it the fastest way, this isn't just a code smell. That's a dead skunk decaying under your pillow.

sbi
I am not the original developer of the app. +1 for the last sentence. It made my day.
Saif Khan
Still, you might refactor out the common code and have that called from the old and new code alike, instead of just copying.
sbi