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 

Rename with path-regex

 
Post new topic   Reply to topic    Peters Flexible RenAmiNg Kit (PFrank) Forum Index -> General Support
View previous topic :: View next topic  
Author Message
Tyri



Joined: 04 Jul 2011
Posts: 2

PostPosted: Mon Jul 04, 2011 10:19 pm    Post subject: Rename with path-regex Reply with quote

Hi.
Is it possible, to rename a File with use variables/Regex-Matches from the parent folder?

eg. File:
parent\Folder123\MyFileName.txt

Replace it to:
parent\Folder123\MyFileName_123.txt

I've tried to use this Regex, but it doesn't work.
Search-Pattern:
Code:
Folder(\d+)/\(.*).txt

Replace-Pattern:
Code:
Folder\1/\\2_\1.txt


Is this possible?

Or better: Direct move the file to the parent folder.. so i have in the "parent"-folder the files of MyFileName_123.txt?

Hope you can help me.

- Tyri
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 09 Mar 2007
Posts: 446
Location: Canada

PostPosted: Tue Jul 05, 2011 6:38 am    Post subject: Reply with quote

When you rename using regular expressions, the expression only processes the filename. It knows nothing about the parent folders.
You have to use the pre-defined 'insert parent folder' command in combination with regular expressions to do what you want.

e.g.

Row: 1
Search:
Replace: '*Insert Folder after*Prefix*'
Custom Format String for Insertion:
'%P1Folder%'
Row: 2
Search: Folder'
Replace:


Use row 1 to bring the parent folder name into the filename and then use the remaining rows to massage the combination.

Hope that helps.

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



Joined: 04 Jul 2011
Posts: 2

PostPosted: Thu Jul 07, 2011 9:11 am    Post subject: Reply with quote

Great!
It works Smile

I like your Program - thank you.
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 -> General Support 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