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
How remove 2 digits in the middle on a file (Read 1387 times)
Dracir
YaBB Newbies
*
Offline



Posts: 1
How remove 2 digits in the middle on a file
Dec 19th, 2012 at 8:26pm
 
Hello to all

I need to do the following using WatchDirectory, and I am not quite sure how to do it:

The following files are print reports. All pdf files has the same lenght name,  and the digits to deleted  are on the same position.

I would like to delete two digits  in a exacte position on a file.
201209191647[highlight]38[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
201209191647[highlight]39[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
201209191647[highlight]40[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
I need delete the digit position 13 and 14  starting at left
On this case [highlight]38[/highlight], [highlight]39[/highlight] and [highlight]40[/highlight] has to be deleted

The result has to be from
C:\AAA\
201209191647[highlight]38[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
201209191647[highlight]39[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
201209191647[highlight]40[/highlight]0054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf

Monitoring the folder who contain these files to modifie every file that appear on this folder and after move this file to other folder.

Move to: (digits 40, 39 and 38 has been deleted)
C:\a\
2012091916470054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
2012091916470054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
2012091916470054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf


Please can you tell me how can I accomplish this using WatchDirectory?

Many thanks

Dracir
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: How remove 2 digits in the middle on a file
Reply #1 - Dec 20th, 2012 at 7:46am
 
Hi,

The way I would do this is to use the Copy Files task and enable "dynamic naming", see
http://www.watchdirectory.net/wdhelp/plugins/wdopAutoCopy.html

Do NOT set the option "dynamic name is a directory" and use the following dynamic name:
C:\A\{left{12,{filetitle}}}{substring{14,50000,{filename}}}

Using the example file
201209191600XX400054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf
{left{12,{filetitle}}} will result in the first 12 positions of the filename without extension:
     2012091916
and {substring{14,50000,{filename}}} will result in the 50000 pos starting at position 14:
     400054596733HOLTER  MAQUGDEXMED    DEXDAT    .pdf

See also http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html
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
 
Page Index Toggle Pages: 1