WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Renaming part of a varible file name (Read 1905 times)
Pete
YaBB Newbies
*
Offline



Posts: 4
Renaming part of a varible file name
May 7th, 2014 at 7:43am
 
Hi there,

How would i go about doing this.

I have PDF files coming into a directory
EG:
LG-p1.pdf
LG-p2.pdf
LG-BC.pdf

I need to keep the number in the file but replace the rest of the text with

123456{1}.pdf
123456{2}.pdf
123456{BC}.pdf
Please note i need the {} symbols in the file name too.

I will also need to be able to quickly change the 123456 part of the name every few days as quickly as possible.

Thanks  Smiley
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Renaming part of a varible file name
Reply #1 - May 7th, 2014 at 8:03am
 
Hello Pete,

Can you give a few more examples? It is not really clear to me how this should work.

Is the "BC" variant always fixed? Do those pdf file names always end with "-BC"?
Same question for the other files, do they always end with "-p#" (where # is a number)? What is the highest number (always 1 digit or can it be several digits)?
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Pete
YaBB Newbies
*
Offline



Posts: 4
Re: Renaming part of a varible file name
Reply #2 - May 7th, 2014 at 11:31pm
 
Hi Thanks for the quick reply.

File names can be as follows.

LG-p (this is always the same)
then followed by a number 1,2,3,4...200max this number needs to be surrounded by "braces"

Then there are 4 other possible variables after LG-p they are as follows

FC, IFC, IBC, BC

See attachment for example
Back to top
 

files.jpg (229 KB | 165 )
files.jpg
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Renaming part of a varible file name
Reply #3 - May 8th, 2014 at 6:25am
 
If it really is that simple (skip the first 4 positions of the filename and put the rest  between {}), you could use the "Copy Files" task, enable the option "dynamic naming" and use something like this for the dynamic name:
f:\testing\target\123456{{substring{4,9999,{filetitle}}}}.{extension}
See http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html

Probably a good idea to setup a filter ( http://www.watchdirectory.net/wdhelp/help/filter_events.html ) to ignore events for files with { in their name.
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Pete
YaBB Newbies
*
Offline



Posts: 4
Re: Renaming part of a varible file name
Reply #4 - May 9th, 2014 at 12:21am
 
PREFECT!!!!
you just sold another copy.

Thanks heaps
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1