Hi all,
I've got another one I'd like your thoughts on. This one changes the phantom number in a 6.6 switch. But I need it to report any errors when it's done.
string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened.
proc main
string sLine ;Line read from text file
integer iLen ;Integer to hold length of read string
string sExtOne ;First extension from line read from text file
string sExtTwo ;Second extension
if fopen 0 "test1.txt" READ ;Open text file
while not feof 0 ;While there is data to be read from the text file
fgets 0 sLine ;Get line of data
strlen sLine iLen ;Find length of line
if iLen == 0 ;If zero, then we have read a blank line and are at the end
exitwhile ;Exit while loop
endif
strtok sExtOne sLine "," ;Get data before the comma
strreplace sExtOne "`"" "" ;Delete quotes from the string
sExtTwo = sLine
strreplace sExtTwo "`"" "" ;Delete quotes from remaining data
strreplace sExtTwo "," "" ;Get rid of extra comma
strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too
transmit "cha-scsu^M"
waitfor "STNO = "
transmit sExtOne
transmit "^M"
waitfor "LOCODE = "
transmit "^M"
waitfor "NEWNO = "
transmit sExtTwo
transmit "^M"
waitfor "DPLN = "
transmit "^M"
waitfor "ITR = "
transmit "^M"
waitfor "COS1 = "
transmit "^M"
waitfor "COS2 = "
transmit "^M"
waitfor "COSX = "
transmit "^M"
waitfor "PUBSCR = "
transmit "^M"
waitfor "NTYPE = "
transmit "^M"
waitfor "ACTCDE = "
transmit "^M"
waitfor "DCFWBUSY = "
transmit "^M"
waitfor "HTLNIDX = "
transmit "^M"
waitfor "EVMSIDX = "
transmit "^M"
waitfor "DEVFUNC = "
transmit "phantom^M"
waitfor "EVMS = "
transmit ";^M"
endwhile
endif
fclose 0
endproc
TEST1.txt
"2871","11871","";"
"2840","11840","";"
"2841","11841","";"
"2842","11842","";"
"5756","16756","";"
I've got another one I'd like your thoughts on. This one changes the phantom number in a 6.6 switch. But I need it to report any errors when it's done.
string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened.
proc main
string sLine ;Line read from text file
integer iLen ;Integer to hold length of read string
string sExtOne ;First extension from line read from text file
string sExtTwo ;Second extension
if fopen 0 "test1.txt" READ ;Open text file
while not feof 0 ;While there is data to be read from the text file
fgets 0 sLine ;Get line of data
strlen sLine iLen ;Find length of line
if iLen == 0 ;If zero, then we have read a blank line and are at the end
exitwhile ;Exit while loop
endif
strtok sExtOne sLine "," ;Get data before the comma
strreplace sExtOne "`"" "" ;Delete quotes from the string
sExtTwo = sLine
strreplace sExtTwo "`"" "" ;Delete quotes from remaining data
strreplace sExtTwo "," "" ;Get rid of extra comma
strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too
transmit "cha-scsu^M"
waitfor "STNO = "
transmit sExtOne
transmit "^M"
waitfor "LOCODE = "
transmit "^M"
waitfor "NEWNO = "
transmit sExtTwo
transmit "^M"
waitfor "DPLN = "
transmit "^M"
waitfor "ITR = "
transmit "^M"
waitfor "COS1 = "
transmit "^M"
waitfor "COS2 = "
transmit "^M"
waitfor "COSX = "
transmit "^M"
waitfor "PUBSCR = "
transmit "^M"
waitfor "NTYPE = "
transmit "^M"
waitfor "ACTCDE = "
transmit "^M"
waitfor "DCFWBUSY = "
transmit "^M"
waitfor "HTLNIDX = "
transmit "^M"
waitfor "EVMSIDX = "
transmit "^M"
waitfor "DEVFUNC = "
transmit "phantom^M"
waitfor "EVMS = "
transmit ";^M"
endwhile
endif
fclose 0
endproc
TEST1.txt
"2871","11871","";"
"2840","11840","";"
"2841","11841","";"
"2842","11842","";"
"5756","16756","";"