Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me ! Search a name doesn't work

Status
Not open for further replies.

ready2fly

Technical User
Jan 29, 2004
4
US
Please help me of the following script. The OMPR2 seems does not work. Anybody can help me.

string fName = "ompr.txt" ; Name of capture file to open.
;string dmsrs = ">"
;string dms
string sLine
string sTok1, sTok2, sTok3, sTok4, sTok5
;string sTok6, sTok7, sTok8, sTok9, sTok10, sTok11
;string sTok12, sTok13, sTok14, sTok15, sTok16, sTok17
;string sTok18, sTok19, sTok20
string sTime, eTime, sDate
string sYY, sMM, sDD
string sHH, sMN, eHH, eMN
string stTemp, etTemp
;string sHost, sHost2, sLce, sUnit
string Out1 ;, Out2 ;, Out3
string OM
;integer INCA, PRE, INFA, NAT, NOV, OUTF, TRU
;integer SBU, MBU, OUTM, CON, TOT, ANS, INVA
;integer BLK, MAX, TRU2, NCTP, NCTF, NPB
Proc Main
Getdata()
endproc

proc Getdata

fopen 1 "D:\DMS\OMPR\OMPR.TXT" READ TEXT ;* Source File
fopen 2 "D:\DMS\OMPR\OMPR_OUTPUT.TXT" CREATE TEXT ;* Destination File

while not feof 1 ;* Go Till End of File (EOF)
fgets 1 sLine ;* START READING LINES
if strfind sLine "NTWRK_OM" ;* Start OMPR Scan
ompr1() ;* Call OMPR Procedure
ompr2()
endif
endwhile ;* End Of File Reached
fclose 1 ;* Close Source File
fclose 2 ;* Close Destination File
endproc ;* We're Outta Here !!

proc Ompr1
while not feof 1

fgets 1 sLine
if strfind sLine "START:"
strtok sTok1 sLine " " 1 ;* Start Date of OMPR
sDate = sTok1
strreplace sDate "START:" "" ;* Reformat the DMS Date Stamp
strreplace sDate "/" " "
strtok sYY sDate " " 1
strdelete sYY 0 2
strtok sMM sDate " " 1
strtok sDD sDate " " 1
strtok sTok2 sLine " " 1 ; START Time of OMPR
sTime = sTok2
strtok sHH sTime ":" 1 ;* Start Hour of OMPR
strtok sMN sTime ":" 1 ;* Start Min of OMPR
strfmt stTemp "%s:%s" sHH sMN
sTime = stTemp
strtok sTok3 sLine " " 1 ;* Start Day of Week of OMPR
strtok sTok4 sLine " " 1 ;* STOP: Field
strtok sTok4 sLine " " 1 ;* End Date of OMPR
strtok sTok5 sLine " " 1 ;* End TIME of OMPR
eTime = sTok5
strtok eHH eTime ":" 1 ;* End Hour of OMPR
strtok eMN eTime ":" 1 ;* End Min of OMPR
strfmt etTemp "%s:%s %s" eHH eMN
eTime = etTemp
strfmt Out1 " %s-%s-%s %s-%s %s %s %02s %s" sMM sDD sYY sTime eTime
endif
endwhile

endproc

proc ompr2
;usermsg "OMPR2 start"
while not feof 1
usermsg "OK ?"
fgets 1 sLine
if strfind sLine "TRK"
usermsg "TRK found"
endif
endwhile
strfmt OM "%s" Out1
fputs 2 OM
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top