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
Need a Plugin (Read 3862 times)
Newone
YaBB Newbies
*
Offline



Posts: 3
Need a Plugin
Apr 20th, 2006 at 3:16pm
 
Hi!
Need a plugin!!! If txt file contains a word "MONEY" then save it in to folder "MONEY"; if "abc" then into "abc"

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



Posts: 2224
The Netherlands
Re: Need a Plugin
Reply #1 - Apr 20th, 2006 at 4:53pm
 
Hi,

I am not sure what you mean.
Is it, if the file has a name like themoney.txt or if the contents of the file has the word money somewhere?

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



Posts: 3
Re: Need a Plugin
Reply #2 - Apr 20th, 2006 at 7:46pm
 
Hi!
Yes - if the contents of the file has the word money somewhere. There is a soft, writing log files 001.txt, 002.txt, 003.txt..... and I need to send them to different e-mails.
Sorry about my english.

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



Posts: 2224
The Netherlands
Re: Need a Plugin
Reply #3 - Apr 20th, 2006 at 8:14pm
 
Your english is fine, I just wanted to make sure what you requested.

copy the following code and save it as [b]automove.bat[/b] using a text-editor (notepad).

[code]
GOTO %WD_REASON%

:FILENEW
:FILECHNG

SET SEARCHFOR=money
SET TARGET=D:\Testing\targ\Money
Call :FindIt
if %RESULT% EQU FOUND GOTO :EOF

SET SEARCHFOR=dollar
SET TARGET=D:\Testing\targ\Dollar
Call :FindIt
if %RESULT% EQU FOUND GOTO :EOF

SET SEARCHFOR=abc
SET TARGET=D:\Testing\targ\abc
Call :FindIt
if %RESULT% EQU FOUND GOTO :EOF

rem all other files are moved to "other"
MD "D:\Testing\Other"
MOVE "%WD_FILE%" "D:\Testing\Other"
GOTO :EOF

:FindIt
SET RESULT=NOTFOUND
FINDSTR /I /C:"%SEARCHFOR%" "%WD_FILE%"
if %ERRORLEVEL% equ 1 GOTO :EOF

MD "%TARGET%"
MOVE "%WD_FILE%" "%TARGET%"
SET RESULT=FOUND

GOTO :EOF


:FILEDEL
:FILEREN
:DIRNEW
:DIRDEL
:DIRREN
:QUIET
[/code]

The above .bat file will check every new file for
money - moves to d:\testing\targ\money
dollar - moves to d:\testing\targ\dollar
abc - moves to d:\testing\targ\abc
all other files are moved to d:\testing\targ\other

Use the [url=www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html]automatically run a batch script[/url] plugin to run the above automove.bat for new and changed files ( http://www.watchdirectory.net/wdhelp/help/wdnewconfigpage4.html ).
That should do the trick.

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



Posts: 3
Re: Need a Plugin
Reply #4 - Apr 20th, 2006 at 9:11pm
 
GREAT!
Working!!!
Thank You!
Really good!
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1