I need some help getting procomm to search the just received file for the type of call it is. There are many call types that need to to be searched and if found run one of 4 different BAT files. I have added the aspect file that I am using now to capture and create 2 differnt files.
proc main
when $CARRIER call check_carrier
while 1
yield
endwhile
endproc
proc check_carrier
set capture overwrite on
capture on
if $CARRIER == 0
capture off
StartProcess ()
endif
endproc
Proc StartProcess
string sLine
; when elapsed 0 40 call quit
;*
;* If WBFC_DATA.TXT Exists, Delete it.
;*
;if isfile "C:\Program files\Symantec\Procomm Plus\Capture\wbfc_data.txt"
; delfile "C:\Data\wbfc_data.txt"
;endif
;* Get Required Data from Capture File and
;* Copy it to NEW WBFC.TXT File.
;*
;* NOTE THAT CAPTURE FILE and DESTINATION MUST BE DIFFERENT !!
;*
fopen 0 "C:\911\wbfc.txt" Read Text ; Source
fopen 1 "C:\911\wbfc_data.txt" Create Text ; Source
while not feof 0
fgets 0 sLine
if strfind sLine "Final Type:"
fputs 1 sLine
endif
if strfind sLine "Loc:"
fputs 1 sLine
endif
if strfind sLine "AKA:"
fputs 1 sLine
endif
endwhile
fclose 0
fclose 1
runfile ()
run "c:\printout"
endproc
proc runfile
string sLine
string sOutput
if fopen 0 "c:/911/wbfc.txt" READ TEXT
while not feof 0
fgets 0 sLine
if strfind sLine "Group:"
strtok sOutput sLine "X," 2
strdelete sOutput 0 1
if fopen 1 "c:/911/output.txt" CREATE TEXT
fputs 1 sOutput
endif
fclose 1
endif
endwhile
endif
fclose 0
; runmap ()
endproc
This works great but now I need it to do more. Here is a copy of the file I need to read for the call types from it is named wbfc_data.txt
Initial Type: NOTIFFC Final Type: NOTIFFC (NOTIFY FIRE CHIEF)
Loc: 1305 W STRASBURG RD ,50 -- STATION 39 ,50 btwn SUGARS BRIDGE RD & NORTHBRO
AKA: Municipality: WBRAD Dev:
See were initial Type: NOTIFFC that is the code word I need to read and then depending on the type code which BAT file will be ran.
Thanks for any help here!
N3MEL
proc main
when $CARRIER call check_carrier
while 1
yield
endwhile
endproc
proc check_carrier
set capture overwrite on
capture on
if $CARRIER == 0
capture off
StartProcess ()
endif
endproc
Proc StartProcess
string sLine
; when elapsed 0 40 call quit
;*
;* If WBFC_DATA.TXT Exists, Delete it.
;*
;if isfile "C:\Program files\Symantec\Procomm Plus\Capture\wbfc_data.txt"
; delfile "C:\Data\wbfc_data.txt"
;endif
;* Get Required Data from Capture File and
;* Copy it to NEW WBFC.TXT File.
;*
;* NOTE THAT CAPTURE FILE and DESTINATION MUST BE DIFFERENT !!
;*
fopen 0 "C:\911\wbfc.txt" Read Text ; Source
fopen 1 "C:\911\wbfc_data.txt" Create Text ; Source
while not feof 0
fgets 0 sLine
if strfind sLine "Final Type:"
fputs 1 sLine
endif
if strfind sLine "Loc:"
fputs 1 sLine
endif
if strfind sLine "AKA:"
fputs 1 sLine
endif
endwhile
fclose 0
fclose 1
runfile ()
run "c:\printout"
endproc
proc runfile
string sLine
string sOutput
if fopen 0 "c:/911/wbfc.txt" READ TEXT
while not feof 0
fgets 0 sLine
if strfind sLine "Group:"
strtok sOutput sLine "X," 2
strdelete sOutput 0 1
if fopen 1 "c:/911/output.txt" CREATE TEXT
fputs 1 sOutput
endif
fclose 1
endif
endwhile
endif
fclose 0
; runmap ()
endproc
This works great but now I need it to do more. Here is a copy of the file I need to read for the call types from it is named wbfc_data.txt
Initial Type: NOTIFFC Final Type: NOTIFFC (NOTIFY FIRE CHIEF)
Loc: 1305 W STRASBURG RD ,50 -- STATION 39 ,50 btwn SUGARS BRIDGE RD & NORTHBRO
AKA: Municipality: WBRAD Dev:
See were initial Type: NOTIFFC that is the code word I need to read and then depending on the type code which BAT file will be ran.
Thanks for any help here!
N3MEL