View Single Post
Old 12-30-2009, 08:10 PM   #22
DedTV
Enthusiast
DedTV began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Dec 2009
Device: PRS-505; Galaxy Tab 7
Quote:
Originally Posted by sircastor View Post
Unless I'm missing something, I would skip trying to get your expression to handle different orders.
I use Bulk Rename Utility (Freeware) and rename the files so they're all consistent which I can then use Calibre to easily handle.
It allows you to rename files using a flexible Match expression, and a flexible Replacement expression so swapping fields is easy. Since all my files are formatted as either Surname, Firstname - whatever.txt or Firstname Lastname - whatever.txt you can build off the comma to match the files you want swapped. I use the regex.
Code:
^(\w+)[ ]*,[ ]*([^-]+?)[ ]*-[ ]*(.*)
with Replace set to \2 \1 - \3. so it only selects the files where the author has a comma in it for renaming and leaves the ones already formatted correctly alone to get a consistent naming scheme.

In case that's all just gibberish, here's an visual example:
http://i97.photobucket.com/albums/l2...Authorswap.jpg

From there the expressions in this thread work perfectly to import into Calibre.

Last edited by DedTV; 12-31-2009 at 10:25 AM.
DedTV is offline