My suggestion is to apply the proper tool for the job. 24x7 supports both JAL and VbScript jobs why don't you use VBScript instead of JAL? File operations in VBScripts should be much faster. By the way, in your JAL script you should use IsEqual insted of Match to compare 2 values. You can also read the entire file into memory using FileReadAll then simply do a search like InStr( FileVar_contents, "\r\nEXT\r\n", 1, iPosVar ). Then if iPosVar >0 process the file otherwise skip it. : I am reading in a set of values from a listoffiles.txt that I need to compare : against a set of values I read in from another file. : Unfortunately this generates a bunch on unnecessary DISK i/o. The first loop : reads in the file I want to process. The loop below reads in a 10 to 12 : files. If there is a match I do not process the file. When I am processing : 26,000 files from loop 1, I do not want to have to read the exclude file : for 26000 times, once for each file. : Code Sample : ..... : //This should be a good file. Lets process it. : FileOpen iExcludeFile, "LineMode", "READ", TRUE, : iExcludeFileNum : EOF (iExcludeFileNum, iExcludeEOFTest) : LoopUntil (iExcludeEOFTEST, EndeLoop) : FileRead (iExcludeFileNum, iExcludeFileVar) : gettoken "," iExcludeFileVar, sFileExt : trim (sFileExt, sfileExt) : upper (sFileExt, sFileExt) : //POS (sFileExt, iFileVar, 1, iExcludeInstr) : ChooseCase (sfileExt, ExcludeProcessFile) : CASE "" : //Empty String : Goto ExcludeProcessFile : CASE " " : //Empty String : Goto ExcludeProcessFile : Case "REM" : //Comment : Goto ExcludeProcessFile : CaseElse : Match iFileVar, SfileExt, iExcludeInstr : IFthen (iExcludeInstr, OkKeepFile) : //a file extension we want to keep was identified in the string. Skip the : File : ExcludeProcessFile: EOF (iExcludeFileNum, iExcludeEOFTest) : EndeLoop: ..... : I tried to read the iexcludeFile's contents into a variable ".bat .exe : .TXT" and use the MATCH command against iFileVar : "C:\temp\deleteme.doc" with out any success. : In VB I would read the values into an array similar to Files2Var(i) and I : would be increase "i" by one each time I read in a new line. The : I would simply loop through the array each time jump into the loop. : I hope my question is clear. Do you have a suggestion to address this? : Thank you : ~Joe
|