Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (***NEW HOME PAGE*** "http://pfrank.atwebpages.com")
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rename based on directory

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
nharding



Joined: 19 Nov 2007
Posts: 11

PostPosted: Wed Dec 12, 2007 2:11 pm    Post subject: Rename based on directory Reply with quote

I've wrote another new user defined command. It's used to rename files based on directory name, If you have

c:\videos\Buffy The Vampire Slayer (Season 1)\BTVS 01.mpg
c:\videos\Buffy The Vampire Slayer (Season 1)\buffy 02.mpg
c:\videos\Buffy The Vampire Slayer (Season 1)\Buffy Vampire Slayer 03.avi
c:\videos\Buffy The Vampire Slayer (Season 1)\BVS 04.avi

The files will be renamed (there are 2 variants of the command), one insists on all words being present (even if in abbreviated form), and the other only needs to match the 1st word. It strips out contents of () [] {} and uses the directories to match.

The files would end up being renamed to
Buffy The Vampire Slayer 01.mpg

I will be posting the code soon, along with my date renamer.

Neil Harding
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Thu Dec 13, 2007 3:12 am    Post subject: Reply with quote

I don't think you need a user defined plugin command for this.

What if you did the following:

Row: 1
Search: '(?i).*?(btvs|buffy|bvs|vampire sl).*?([0-9]{2,2})[.](.{3,3})$'
Replace: ' \2.\3'
Row: 2
Search:
Replace: '*Insert Folder before*Prefix*'
Row: 3
Search: '(?x) [\{\(\[]+.*?[\]\}\)]+ # delete brackets + contents'
Replace:

For the folder insertion, just configure the folder insertion option to not add a separator (don't enter any characters in separator specifier).

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nharding



Joined: 19 Nov 2007
Posts: 11

PostPosted: Thu Dec 13, 2007 3:24 am    Post subject: Reply with quote

The idea of this user defined command is that it automatically generates the regular expression. It even looks through the entire path, so if you have Josh Wedon\Buffyverse\Buffy the Vampire Slayer\Season 1\, it will look and see if any of the parts match.

Neil Harding
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Thu Dec 13, 2007 7:07 am    Post subject: Reply with quote

Cool - Can't wait to see it.

Peter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com