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 

Inserting text after the Nth occurence of a character

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



Joined: 17 Feb 2011
Posts: 1

PostPosted: Thu Feb 17, 2011 6:31 pm    Post subject: Inserting text after the Nth occurence of a character Reply with quote

I am attempting to insert "mytext_" after the 4th occurence of "_" in my file name. Can you help me out?

Thanks,
Dave
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 448
Location: Canada

PostPosted: Sat Feb 26, 2011 1:32 am    Post subject: Reply with quote

I'll just insert what I sent in a private email:
=====================

Hi Dave,

You can try this sequence in the custom renaming creator (do not include the single quote):

Row: 1
Search: '(?E)^(Dark.*?_.*?_.*?_.*?_)(.*)'
Replace: '\1SuperW_\2_Interlace_Double_12000'

That will take care of the 'Dark' files. Just use the same type of line for the 'Light' files.

Let me know if you have any more questions.

Peter.


--- On Fri, 2/18/11, xxx wrote:


Friday, February 18, 2011, 2:35 PM

Peter,



I am trying to rename files such as these:



DarkT_RBstandard_974571F_1_27_107.tif

LightT_RBstandard_974558F_1_15_15.tif

DarkKids_RBstandard_974675F_1_104_21.tif

LightYouth_RBstandard_974876F_1_90_0.tif



…to an updated naming convention to work with a proprietary RIP software’s Hot folders.



I need to add a field to indicate print mode after the 4th occurrence of the “_”. (or Substitute the 4th “_” with “_mytext”)



For Light colored garments (any file starting with “Light”) I will need “CMYK”; for dark garments (any file starting with “Dark”) I will need to add “SuperW”



No problem in identifying which files to indicate for the print mode, I got that ‘^Light’ or ‘^Dark’. I just can’t figure out how to how to identify “after the 4th _”.



All of the files then need 3 additional fields added at the end. These fields will always be “_Interlace_Double_12000”. I have that part figured out as well, simply using the Predefined Regex for “Insert after”.



My finished file names should look like these:



DarkT_RBstandard_974571F_1_SuperW_27_107_Interlace_Double_12000.tif

LightT_RBstandard_974558F_1_CMYK_15_15_Interlace_Double_12000.tif

DarkKids_RBstandard_974675F_1_SuperW _104_21_Interlace_Double_12000.tif

LightYouth_RBstandard_974876F_1_CMYK _90_0_Interlace_Double_12000.tif



I would appreciate any help you could provide.



Thanks,

Dave
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