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 

Adding a counter mid-filename

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



Joined: 08 Mar 2012
Posts: 3

PostPosted: Thu Oct 30, 2014 1:23 am    Post subject: Adding a counter mid-filename Reply with quote

So I figured out how to add a counter to the start of a file name. And to the end. And I can change the start value and the increment. But I can't figure out how to add it in a specific place.

I have filenames of the format yymmddab - Description.jpg

yy, mm, dd are numeric and a and b are lower case letters, where none, one or two of them are present.

I want to add a hyphen and a counter value at position 7 in the string. Deleting the 0, 1 or 2 characters would be a bonus.

The desired result will be yymmdd-counter - Description.jpg.

Surely this can be done.

(This is a really useful and fun utility.....interesting to see what others are using it for)
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Fri Oct 31, 2014 2:22 am    Post subject: Reply with quote

Enter the following in the custom renaming creator (don't include the single quotes):

Row: 1
Search: '^(.{6,6}).*? - (.*)'
Replace: '\1 -\2'
Row: 2
Search:
Replace: '*Insert Counter after*Position*6*of*Prefix*'


The first row gets rid of the characters between the 6 character date and the first '-'.
The second row inserts the counter after the 6 character date.
You can also insert the second line by setting up the pre-defined command to insert a counter after position 6 and hitting 'Insert in List'.
Before hitting 'scan', go to the options window and configure the counter insertion so that the counter is preceded by a '-'
Then hit Scan.

Hope that helps.

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



Joined: 08 Mar 2012
Posts: 3

PostPosted: Sun Nov 02, 2014 3:10 am    Post subject: Reply with quote

Peter, thank you. Worked like a charm. I don't understand it, but it worked.
Back to top
View user's profile Send private message
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