Elton Stoneman

  Home  |   Contact  |   Syndication    |   Login
  120 Posts | 0 Stories | 3590 Comments | 0 Trackbacks

News

Archives

Post Categories

Smart Rename is a little tool I put together a while back and have found pretty useful – it's up on CodePlex here: Smart Rename.

It lets you rename files in bulk, based on a pattern you provide:

It should be fairly self-explanatory, but in case not: anything in the pattern flagged with %...% will be evaluated for each file in the list and replaced with a computed value. Arguments can be passed to the computing component with the syntax %replacement%{arg1:arg2}. You can preview the new name before making any changes, and when you commit it will report whether it was successful at renaming each file.

One frequent use is for changes to project names halfway through development. So when Project Tango becomes Project Sierra, you can use %string%{Acme.Tango:Acme.Sierra} to rename C# projects with names like Acme.Tango.Entities.csproj. Or if you want to prefix filenames with the folder they're in and suffix them with the current date, you can do it with %folder%_%filename%_%date%. Some of the replacements available look odd, but I've had a use for them all at some time. By default SmartRename retains the original file extension, but you can override that to change extensions too.

Technically there isn't much to it. Replacements are evaluated through classes which implement IReplacement and are configured using Castle. Currently the following are provided:

Adding new replacement functionality is very simple, just a case of implementing the IReplacement interface (or extending from ReplacementBase) and adding the class as a component in the app config.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Thursday, June 19, 2008 10:30 PM

Feedback

# re: Smart Rename tool on CodePlex 7/29/2009 11:08 AM Matthew
Powerfully awesome tool! It just saved me hours in testing a bulk process. Your tool completely made my day! Thank You so much for making this available.

# re: Smart Rename tool on CodePlex 7/29/2009 1:38 PM Elton
Glad to hear it was helpful for you Matthew, thanks very much for your comment.

# re: Smart Rename tool on CodePlex 4/8/2011 9:04 AM mike
How do I escape spaces in string replacements?
right now, have a space in either of the strings (i.e. %string%{nospace:with space} causes weird results.


# # re: Smart Rename tool on CodePlex 10/14/2011 3:41 AM Mulberry Outlet
Smart Rename is a little tool I put together a while back and have found pretty useful – it's up on CodePlex here

# re: Smart Rename tool on CodePlex 11/2/2011 11:29 PM group training
What is the purpose of having this smart rename tool on codeplex? group training

# re: Smart Rename tool on CodePlex 11/9/2011 8:38 AM columbia jackets
Overall the jacket was quite nice. I will keep it but with reservations. Mainly, the outer zipper is flimsy.

# re: Smart Rename tool on CodePlex 11/19/2011 7:50 AM North Face Jackets For Women
North Face Jackets, both North Face Jackets For Women and North Face Jackets For men, are playing an important role in our fall, winter and spring life. They can be your daily necessities. They can also be a great gift to your families or friends to show your love. An awesome North Face Jackets as a birthday, Thanks Given Day, Christmas Day or Valentine's Day gift would surely make the receiver full of gratitude and love towards you.

# re: Smart Rename tool on CodePlex 1/12/2012 8:55 AM North Face Fleece Clearance
When you come into North Face shop, you will find that cheap north face jackets is the most popular items of the North Face products, comparing to other items of North Face outdoor products.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: