I am having trouble with a procomm script. I think my tab deliminated file has an issue. Here is what I get when I run the script. It also changed the fields when I saved from excel to tab deliminated. thank you.
>****
OVL000
>ld 11
SL1000
MEM AVAIL: (U/P): 97479530 USED U P: 6667392 105491 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760
REQ: new
TYPE: 3902
TN tSCH0030
TN nSCH0030
TN
SCH0120
Here is my script and txt file.
proc main
string sline, tn,ncos,rnpg,key0,cpnd
fopen 0 "3902.txt" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok ncos sLine "`t" 1 ;Get the second field
strtok rnpg sLine "`t" 1 ;Get the third field
strtok key0 sLine "`t" 1 ;Get the fourth field
strtok cpnd sLine "`t" 1 ;Get the fifth field
set txpace 30
transmit "****^M"
waitfor ">"
transmit "ld 11^M"
waitfor "req:"
transmit "new^M"
waitfor "type"
transmit "3902^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "des"
transmit "3902^M"
waitfor "CUST"
transmit "0^M"
waitfor "erl"
transmit "^M"
waitfor "fdn"
transmit "^M"
waitfor "tgar"
transmit "1^M"
waitfor "ldn"
transmit "^M"
waitfor "ncos"
transmit ncos
transmit "^M"
waitfor "rnpg"
transmit rnpg
transmit "^M"
waitfor "ssu"
transmit "^M"
waitfor "sgrp"
transmit "^M"
waitfor "cls"
transmit "CTD PUA HTA TDD HFA MWA LNA CNDA^M"
waitfor "hunt"
transmit "000^M"
waitfor "lhk"
transmit "0^M"
waitfor "lnrs"
transmit "^M"
waitfor "sci"
transmit "^M"
waitfor "plev"
transmit "^M"
waitfor “dani”
transmit “^M”
waitfor "ast"
transmit "^M"
waitfor "iapg"
transmit "^M"
waitfor "mlwu_lang"
transmit "^M"
waitfor "mlng"
transmit "^M"
waitfor "dndr"
transmit "^M"
waitfor "key "
transmit key0
transmit "^M"
waitfor "marp"
transmit "^M"
waitfor "cpnd"
transmit "new^M"
waitfor "name"
transmit cpnd
transmit "^M"
waitfor “xpln”
transmit "^M"
waitfor “display_fmt”
transmit “^M”
waitfor “vmb”
transmit “^M”
waitfor "key"
transmit "1 rnp^M"
waitfor "key"
transmit "2 cfw 4^M"
waitfor "key"
transmit "3 ao6^M"
waitfor "key"
transmit "4 trn^M"
waitfor "key"
transmit "5 mwk 4900^M"
endwhile
fclose 0
endproc
tn ncos rnpg key0 cpnd
12 1 7 10 4 1 2089 peter parker
>****
OVL000
>ld 11
SL1000
MEM AVAIL: (U/P): 97479530 USED U P: 6667392 105491 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760
REQ: new
TYPE: 3902
TN tSCH0030
TN nSCH0030
TN
SCH0120
Here is my script and txt file.
proc main
string sline, tn,ncos,rnpg,key0,cpnd
fopen 0 "3902.txt" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok ncos sLine "`t" 1 ;Get the second field
strtok rnpg sLine "`t" 1 ;Get the third field
strtok key0 sLine "`t" 1 ;Get the fourth field
strtok cpnd sLine "`t" 1 ;Get the fifth field
set txpace 30
transmit "****^M"
waitfor ">"
transmit "ld 11^M"
waitfor "req:"
transmit "new^M"
waitfor "type"
transmit "3902^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "des"
transmit "3902^M"
waitfor "CUST"
transmit "0^M"
waitfor "erl"
transmit "^M"
waitfor "fdn"
transmit "^M"
waitfor "tgar"
transmit "1^M"
waitfor "ldn"
transmit "^M"
waitfor "ncos"
transmit ncos
transmit "^M"
waitfor "rnpg"
transmit rnpg
transmit "^M"
waitfor "ssu"
transmit "^M"
waitfor "sgrp"
transmit "^M"
waitfor "cls"
transmit "CTD PUA HTA TDD HFA MWA LNA CNDA^M"
waitfor "hunt"
transmit "000^M"
waitfor "lhk"
transmit "0^M"
waitfor "lnrs"
transmit "^M"
waitfor "sci"
transmit "^M"
waitfor "plev"
transmit "^M"
waitfor “dani”
transmit “^M”
waitfor "ast"
transmit "^M"
waitfor "iapg"
transmit "^M"
waitfor "mlwu_lang"
transmit "^M"
waitfor "mlng"
transmit "^M"
waitfor "dndr"
transmit "^M"
waitfor "key "
transmit key0
transmit "^M"
waitfor "marp"
transmit "^M"
waitfor "cpnd"
transmit "new^M"
waitfor "name"
transmit cpnd
transmit "^M"
waitfor “xpln”
transmit "^M"
waitfor “display_fmt”
transmit “^M”
waitfor “vmb”
transmit “^M”
waitfor "key"
transmit "1 rnp^M"
waitfor "key"
transmit "2 cfw 4^M"
waitfor "key"
transmit "3 ao6^M"
waitfor "key"
transmit "4 trn^M"
waitfor "key"
transmit "5 mwk 4900^M"
endwhile
fclose 0
endproc
tn ncos rnpg key0 cpnd
12 1 7 10 4 1 2089 peter parker