Peters Flexible RenAmiNg Kit (PFrank) Forum Index Peters Flexible RenAmiNg Kit (PFrank)
Support and Discussion Site for the PFrank File/Folder Renaming Tool (http://www3.telus.net/pfrank)
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

If..Then

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



Joined: 12 Oct 2008
Posts: 3

PostPosted: Mon Jun 08, 2015 10:13 pm    Post subject: If..Then Reply with quote

I have looked through the forums, but I obviously can't phrase my search well enough to find what I'm looking for. I can't be the only person that needs to do something like this.

How can I perform an action only on certain items in a folder? For example, in a folder I have files that are titled as follows:

The Righteous Brothers - Little Latin Lupe Lu.mp3
Roy Orbison - The Crowd.mp3
The Chordettes - Lollipop.mp3

I want to change only filenames that start with 'The' so after running PFrank, the list would look as follows:

Righteous Brothers, [The] - Little Latin Lupe Lu.mp3
Roy Orbison - The Crowd.mp3
Chordettes, [The] - Lollipop.mp3

I have used this sequence of commands to change the files:

Search ^The Replace , [The] -
Search (?x)(.*?)[ ]*?[-]+(?x)(.*?)[ ]*?[-]+[ ]*?(.*)$ Replace \2 \1 -\3
Search (?x)[ ]*[-][ ]* Replace -

Which does the job nicely as long as ALL the filenames start with 'The'

So what I'm asking , I guess, is how to do something like:

:TOP
Get Filename
IF the file name begins with 'The' (^The) THEN
Replace it with ,[The] -
Execute Swap commands
END IF
IF (there are more files) THEN GOTO TOP

Thanks for your help!
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Wed Jun 17, 2015 4:46 am    Post subject: Reply with quote

Try this in the custom renaming creator (do not include the single quotes):

Row: 1
Search: '^The(.*) -'
Replace: '\1, [The] -'


Hope that helps.

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 -> Regular Expressions 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