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 "101 -video.avi" to "Video - S01E01.av

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



Joined: 18 Dec 2008
Posts: 2

PostPosted: Fri Dec 19, 2008 12:00 am    Post subject: Rename "101 -video.avi" to "Video - S01E01.av Reply with quote

Hi all.
I like the look of this program but I am at a loss with how to do the renaming I'm after.

I have a folder full of files named like: "403 - video title.avi"
I'd like to rename the files so that the digits are used at the end of the title with extra characters for season and episode, also I would like the first letters of each word capitalised .
So the above would become: "Video Title - S04E03.avi"

Is this possible?
If so, can anyone provide some help with this?
If not, can anyone recommend a product that can do this?

**edit**
After looking through the regex section in the help manual some more I still have no clue.
I am having a very hard time trying to understand the regular expressions.
Does anyone know of any online tutorials or other learning material that might help me understand?


Last edited by shtonkalot on Fri Dec 19, 2008 2:39 am; edited 1 time in total
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Fri Dec 19, 2008 2:32 am    Post subject: Reply with quote

This can be done fairly easily. Paste the follwoing info into the specified rows (do not inlcude the single quotes).

Row: 1
Search: '(?E)^([0-9]+)\s*\-\s*(.*)'
Replace: '\2 - \1'
Row: 2
Search:
Replace: '*Title Case (Also Deletes Extra Whitespace) in*All*'
Row: 3
Search: '(?x) ([^0-9]|^)([0-9]{3,3})([^0-9]|$) # pad 3 digit number'
Replace: '\g<1>0\2\3'
Row: 4
Search: '([0-9]{2,2})([0-9]{2,2})'
Replace: 'S\1E\2'

A simple way to paste the info is to use the mouse to block select all of the above, then click on the PFrank main window and press CTL-F2.

the first row swaps the required fields.
the second row capitalizes each word. There are options to control the capitilization.
the third row pads 3 digit number to 4 digits (ie. adds a leading zero if necessary
the fourth row adds the S and E indicators.

Press 'scan' and check the preview window that popos up.

Hope that helps.

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



Joined: 18 Dec 2008
Posts: 2

PostPosted: Fri Dec 19, 2008 2:41 am    Post subject: Reply with quote

Thanks very much Peter.

I'm very interested in how these regular expressions work so I appreciate you explaining what each expression does.

I was editing my last post as you replied.

admin wrote:
Press 'scan' and check the preview window that popos up.

Ah, the only problem now is that a couple of the file names have numbers (specifically "2000" in this case) at the end of the file name before the extension.
These too get renamed with the S and E in them.

Apart from that though it worked brilliantly.

Thanks again.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Fri Dec 19, 2008 5:35 am    Post subject: Reply with quote

Hi,

To fix the problem with numbers in the title, try replace row 4 with the following info:

Row: 4
Search: '([0-9]{2,2})([0-9]{2,2})\.'
Replace: 'S\1E\2.'

This specifies that only numbers before a '.' will have the S and E added.

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