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
Sort files into folder based on the filename. (Read 3053 times)
adi white
YaBB Newbies
*
Offline



Posts: 7
Sort files into folder based on the filename.
Oct 8th, 2015 at 5:29pm
 
Hello I want to copy, using Watch from folder A to folder B and then sort the files into subfolders based on part of the file name. for example.
File name avontuur-oratorio.pdf would be copied from folder \A\ and placed into folder \B\avontuur\avontuur-oratorio.pdf
Is this possible?? Cheesy Wink
Back to top
 
 
IP Logged
 
adi white
YaBB Newbies
*
Offline



Posts: 7
Re: Sort files into folder based on the filename.
Reply #1 - Oct 8th, 2015 at 6:07pm
 
Using dynamic naming I have managed to get it to get it placed into a folder like this

\B\al shaqab-olympic glory\al shaqab-olympic glory

but i dont want the part of the filename after the - to exist in the name of the folder. I need it to look like this.

\B\al shaqab\al shaqab-olympic glory.pdf
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: Sort files into folder based on the filename.
Reply #2 - Oct 9th, 2015 at 1:35pm
 
You will need to apply one of the dynamic naming FUNCTIONS which are not on the popup menu. They are described at the bottom of this page: http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html

You probably need the {stringbefore} function, something like
c:\SomeFolder\{stringbefore,-,{filetitle}}\{filename}

Gert
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
 
adi white
YaBB Newbies
*
Offline



Posts: 7
Re: Sort files into folder based on the filename.
Reply #3 - Oct 9th, 2015 at 6:07pm
 
Gert you sir are a genius. It works a treat now. Thank you very much. Grin Grin Grin Grin Grin Grin Grin Grin Grin Grin
Back to top
 
 
IP Logged
 
adi white
YaBB Newbies
*
Offline



Posts: 7
Re: Sort files into folder based on the filename.
Reply #4 - Oct 9th, 2015 at 6:42pm
 
Actually what function could i use to move the file but remove the part of the name before the - altogether?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: Sort files into folder based on the filename.
Reply #5 - Oct 9th, 2015 at 6:59pm
 
Something like
Code:
c:\SomeFolder\{stringbefore,-,{filetitle}}\{stringafter,-,{filetitle}}.{extension}
 

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
 
adi white
YaBB Newbies
*
Offline



Posts: 7
Re: Sort files into folder based on the filename.
Reply #6 - Oct 21st, 2015 at 6:12pm
 
Thanks again Gert. You are a lifesaver as usual.

Another question and im sorry if im going over my quota here.

I want to be able to pick a file up from folder A and move  copy's of it into folders B and C. What Plugin task is best to achieve this? thanks in advance sir. Smiley Smiley Smiley


Over the past years I've purchased Watchdirectory at multiple sites and it never ceases to disappoint both myself and my colleagues thanks for everything Gert.
Back to top
 
 
IP Logged
 
Dirk
YaBB Administrator
*****
Offline



Posts: 661
South Germany
Re: Sort files into folder based on the filename.
Reply #7 - Oct 21st, 2015 at 7:53pm
 
Use the Sort-Plugin
http://www.watchdirectory.net/wdhelp/plugins/wdopAutoSort.html

Make only the last rule as 'final rule'.
Back to top
 

Viele Grüße / Best regards
Dirk - GdP Software

dirk [at] gdpsoftware [dot] com
http://blog-de.gdpsoftware.com
Webseite: http://www.gdpsoftware.com
WWW WWW  
IP Logged
 
adi white
YaBB Newbies
*
Offline



Posts: 7
Re: Sort files into folder based on the filename.
Reply #8 - Oct 22nd, 2015 at 11:50am
 
Perfect as usual guys. It works brilliantly. Thanks again guys. Cheesy Grin Smiley Smiley Smiley
Back to top
 
 
IP Logged
 
puddwud
YaBB Newbies
*
Offline



Posts: 5
UK
Re: Sort files into folder based on the filename.
Reply #9 - Mar 8th, 2016 at 4:58pm
 
Hi there, I've a similar task as described in this post but can't get my 'version' to work.

If have a filename of the form "000000-00-X*-X*-Y_X*.tif", where the "X*" substring is of variable length.

I'm needing to move this image into folder who's name needs to end with the last character of the filename that appears before the underscore eg "Y" in this case.

The dynamic naming to get my destination path is:

tifs-{firstdir}-{substring{0,1,{stringbefore{_,{filetitle}}}}}\{filename}

but I end up with the directory name ending in the 1st character of the filename and if I use

tifs-{firstdir}-{substring{0,1,{stringbefore{_,{reverse{filetitle}}}}}}\{filenam
e}

I end up with the directory name ending in a "{".

Any ideas please.  Thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: Sort files into folder based on the filename.
Reply #10 - Mar 9th, 2016 at 6:19am
 
I think you need something like
c:\temp\tifs-{firstdir}-{right{1,{stringbefore{_,{filetitle}}}}}\{filename}

I used a very crude tool to create this {dynamic name}, makes it a little easier to experiment with them.

If you want to play with this tool: www.gdpsoftware.com/downloads/DynamicDebugger.zip
Back to top
 

dnd.png (33 KB | 105 )
dnd.png

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
 
puddwud
YaBB Newbies
*
Offline



Posts: 5
UK
Re: Sort files into folder based on the filename.
Reply #11 - Mar 9th, 2016 at 2:26pm
 
Thank you very much, that's worked perfectly.  Thanks also for the debugger link, it maybe useful for future work.  Much appreciated.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1