I try to write the files to the log,then run the script to check for files in the folder if the files already in the log, then dont process it. the script missing something may be in the "position" please help. thank you
//Check to see if it already in the logs
//Processed Log File
Let>ProcessedLog=E:\TESTFOLDER\Jumble.log
GetFileList>E:\TESTFOLDER\source\*.pdf,file_list,;
Separate>file_list,;,JumbleInbox
If>JumbleInbox_count=0,end
Let>k=0
Repeat>k
Let>k=k+1
Let>orgfile=JumbleInbox_%k%
//Get a list of folders in InFolder
//Loop through folder list
//Does this one exist in processed.log
Let>SendIt=TRUE
IfFileExists>%ProcessedLog%
ReadFile>%ProcessedLog%,ProcessedList
Position>%ogrfile%,ProcessedList,1,p
If>p>0
//This file already processed
Let>SendIt=FALSE
Endif
Endif
//Ok to process this file
If>SendIt=TRUE
//Write to processed log
WriteLn>%ProcessedLog%,r,%orgfile%
goto>sendToDTI
Endif
Until>k=files_count
Endif
//NOTUSE//filedate>orgfile,DateLimit
Label>sendToDTI
MoveFile>E:\TESTFOLDER\source\%orgfile%,E:\TESTFOLDER\destination\%orgfile%
until>k,JumbleInbox_count
Label>end
exit
Check if file in the log
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
No time for code right now, but how about this approach?
GetFileList and output to a variable/file
Use RegEx on that output to find the file name (%ogrfile% ?), will not need to separate or loop. Basically one command to get the info.
GetFileList and output to a variable/file
Use RegEx on that output to find the file name (%ogrfile% ?), will not need to separate or loop. Basically one command to get the info.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!