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
create a csv file (Read 2676 times)
jlucka
YaBB Newbies
*
Offline



Posts: 9
create a csv file
Apr 11th, 2006 at 11:53pm
 
Hello

I send some PDF file in a directory. The name of this PDF file contains some fields.
For example: AAAAA-BBBBBB-CCCC.pdf and i must create a csv file wich contains "AAAAA";"BBBBBB";"CCCC" and after that i will move this 2 files in an other directory or maybe in a FTP server.

Is this possible with watchdirectory ?


Thanks for your answer

Best regards
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2237
The Netherlands
Re: create a csv file
Reply #1 - Apr 12th, 2006 at 5:52am
 
Hello,

Yes that should be possible. Create a task that uses the batch file plugin and configure it so it only starts for *.PDF files (or perhaps for correctly formed filenames use the format *\?????-?????-?????.pdf).
Let it start this script:
Code:
rem split the name
SET P1=%WD_FILE_B:~0,5%
SET P2=%WD_FILE_B:~6,5%
SET P3=%WD_FILE_B:~12,5%
rem write the info to a CSV with the same name as the original file
ECHO "%P1%";"%P2%";"%P3%" > "%WD_FILE_D%%WD_FILE_B%.CSV"
rem move both files to another directory
MOVE "%WD_FILE%" "C:\TargetDirectory"
MOVE "%WD_FILE_D%%WD_FILE_B%.CSV" "C:\TargetDirectory"
rem done!
 



You can get more info about the %VARIABLES% used on this page
If you want to do more with those files, just create a new task that monitors C:\TargetDirectory (the "output directory" of the script above).

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



Posts: 9
Re: create a csv file
Reply #2 - Apr 12th, 2006 at 1:07pm
 
Hi,

Thanks a lot Gert.


Great job as always.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1