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 

how to crop long filename length with specification?

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



Joined: 19 Jan 2009
Posts: 1

PostPosted: Mon Jan 19, 2009 1:44 am    Post subject: how to crop long filename length with specification? Reply with quote

hi pfrank users.. i have large library of .wav files that need to be transferred to an akai mpc1000 sampler.. the filename length limit on this sampler is 16 characters.. however most of my filenames are much longer..
with most of my samples the filename is formatted like this:

nameofsampleorigin-briefsampledescription12.wav

i would like to keep only the first 3 characters of "nameofsampleorigin" field and keep a hyphen "-" and then keep the first 10 characters of "briefsampledescription" and then the last 2 characters (which are usually numbers).. resulting in:

nam-briefsampl12.wav


this sounds like a complex regex and been having troubles trying to figure it out on my own.. was hoping someone could help as to how i could do this.. thank you
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Mon Jan 19, 2009 3:04 am    Post subject: Reply with quote

Hi,

One regex will do it - for this case it's all about grouping.
Enter the following data into the custom renaming creator (do not include the single quotes):

Row: 1
Search: '^(.{3,3})(.*?)-(.{10,10})(.*?)(..)[.]wav$'
Replace: '\1-\3\5.wav'


The search expression defines 5 groups. 3 of the groups are used in the replace expression.

Hope that helps. If you need more assistance, then let me know.

Cheers,

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