This can be achieved using the StrSearchDelimited function as illustrated in the script below: benchmark BenchmarkName use"kernel.bdh" const LOGFILE := "C:\\temp\\logfile.txt"; //path to file var sLog : string; sResult : string; nSize : number; hFile : number; dcluser user VirtUser transactions TmyTrans1 : 1; dcltrans transaction TmyTrans1 begin// Open and read in everything from logfile.txt into the variable sLog FOpen(hFile, LOGFILE); FSizeGet(hFile, nSize); FRead(hFile, sLog, nSize); FClose(hFile); //Search for a string delimited on the left by left_boundary and on the right by right_boundary. //sResult receives the found substring StrSearchDelimited(sResult, nSize, sLog, "left_boundary",1,"right_boundary", 1, STR_SEARCH_FIRST); WriteLn(sResult); end TmyTrans1; Please see Silk Performer Help for details on the usage and syntax of the functions used in the above script.
↧