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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with a Procomm Script 1

Status
Not open for further replies.

tfp2006

Programmer
Apr 28, 2006
51
US
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


 
I tried as a csv and here are the reults.


ld 11
SL1000
MEM AVAIL: (U/P): 97479462 USED U P: 6667392 105559 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 12 1 7 10
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr SCH0360
KEY 2089
SCH0361
KEY

12 1 7 10 4 1 0 scr 2089 peter parker
 
csv script

proc main

string sline, tn,ncos,rnpg,key0,cpnd

fopen 0 "3902test.wud" 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 "`," 1 ;Get the first field
strtok ncos sLine "`," 1 ;Get the second field
strtok rnpg sLine "`," 1 ;Get the third field
strtok key0 sLine "`," 1 ;Get the fourth field
strtok cpnd sLine "`," 1 ;Get the fifth field

set txpace 30
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 “RCO”
transmit “^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 "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
 
Try this with your tab delimited file again.

>>>>>>>>>>>>>>>>>>>>

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 50

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 "RCO"
transmit "^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 "0 scr "
transmit key0
transmit " 0^M~"
waitfor "CPND"
transmit "new^M~"
waitfor "NAME"
transmit cpnd
transmit "^M~"
waitfor "XPLN"
transmit "^M~"
waitfor "DISPLAY_FMT"
transmit "^M~"
waitfor "VMB"
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~"
waitfor "KEY "
transmit "^M~"

endwhile

fclose 0

endproc
 
A few errors you had was you were telling the script your DN, but you weren't including any SCR/SCN/MCR/MCN or CLID identifer.

Also had to remove(transmit "^M")after the (waitfor "VMB")

 
Same results.


>ld 11
SL1000
MEM AVAIL: (U/P): 97479462 USED U P: 6667392 105559 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 12 1 7 10
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr 2089
MARP
CPND new
NAME peter parker
XPLN

DISPLAY_FMT
VMB
KEY

MGMT001 TNB NEW TYPE:3902 TN:12 1 7 10

MEM AVAIL: (U/P): 97479258 USED U P: 6667474 105681 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 631 USED: 129 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: 31935 USED: 825 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: 1 rnp
SCH0099 1?
 
What if you try taking all the waitfor's out after the cpnd, until your next KEY entry?

>>>>>>>>>>>>>>>>>>>>>>

waitfor "KEY "
transmit "0 scr "
transmit key0
transmit " 0^M~"
waitfor "CPND"
transmit "new^M~"
waitfor "NAME"
transmit cpnd
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY "
transmit "1 rnp^M~
 
I found the solution to my script issue. I had to add TEXT in the top of the script. See below. Here is a link to the aspect forum solution. The only issue is at the end of the script it starts again. thread448-1486987


>ld 11
SL1000
MEM AVAIL: (U/P): 97477695 USED U P: 6668931 105787 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 12 1 7 10
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr 2089 0
MARP
CPND new
NAME peter parker
XPLN
DISPLAY_FMT
VMB
KEY 1 rnp
KEY 2 cfw 4
KEY 3 ao6
KEY 4 trn
KEY 5 mwk 4900
KEY

MGMT001 TNB NEW TYPE:3902 TN:12 1 7 10

MEM AVAIL: (U/P): 97477516 USED U P: 6669013 105884 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 631 USED: 129 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: 31935 USED: 825 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: ld 11
REQ LDIS


NPR002
REQ: new
TYPE: 3902
TN
SCH0120



proc main

string sline, tn,ncos,rnpg,key0,cpnd

fopen 0 "3902.txt" READ TEXT ;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 "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 "RCO"
transmit "^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 "0 scr "
transmit key0
transmit " 0^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"
waitfor "KEY"
transmit "^M"
endwhile
fclose 0


endproc


 
Good catch on the 'TEXT'

To keep your script from continuing to loop, add an integer.


proc main
integer count=0
string sline, tn,ncos,rnpg,key0,cpnd

Then toward the end of the script, insert [count+=1] just before the [endwhile]

count+=1

endwhile

fclose 0
 

Jamie2,

I tried adding the integer but it still started building another set at the end. Any ideas? thanks


REQ: new
TYPE: 3902
TN 12 1 7 11
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr 2089 0
MARP
CPND new
NAME peter parker
XPLN
DISPLAY_FMT
VMB
KEY 1 rnp
KEY 2 cfw 4
KEY 3 ao6
KEY 4 trn
KEY 5 mwk 4900
KEY

MGMT001 TNB NEW TYPE:3902 TN:12 1 7 11

MEM AVAIL: (U/P): 97474298 USED U P: 6669078 109037 TOT: 104252413
DISK SPACE NEEDED: 167 KBYTES
DIGITAL TELEPHONES AVAIL: 631 USED: 129 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: 31935 USED: 825 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: ld 11
REQ LDIS


NPR002
REQ: new
TYPE: 3902
TN
SCH0120


 
This is not looping for me. It completes and stops the script. Tested with two phones in the text file, and I had it set as tab delimited.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


proc main
integer count=0
string sline, tn,ncos,rnpg,key0,cpnd

fopen 0 "c:\3902.txt" READ TEXT ;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 50

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 "RCO"
transmit "^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 "0 scr "
transmit key0
transmit " 0^M~"
waitfor "CPND"
transmit "new^M~"
waitfor "NAME"
transmit cpnd
transmit "^M~"
transmit "^M~"
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 3353^M~"
waitfor "KEY "
transmit "^M~"

count+=1

endwhile

fclose 0

endproc
 
could you post the text file. maybe thats where my issue is.
 
36 1 6 14 4 1 7800 peter,parker
36 1 6 15 4 1 7806 clark,kent
 
count += 1
endwhile
fclose 0
fclose 1
call main

your missing the call main

john poole
bellsouth business
columbia,sc
 
tfp2006 Here one that I just tested. Don't ask me way but I had to common out the "^M" after the VMB prompt.
I also save the file a excel "csv" I've had troubles when saving them as "tab delimited" sometimes you have to added an extra "^M" sometimes you have to remove an "^M". This script will also do a list of TN's.
Oh well hear what I came up with. GOOD LUCK

; Script for building new 3902
proc main

#define LOGI_NAME "Sam" ;"Put your login name here if you use name login"
#define PSWD "PDT_backdoor" ;"Put your password here"

set txpace 75 ;delay for keyboard

transmit "****^M"
transmit "LOGI "
transmit LOGI_NAME
transmit "^M"
transmit PSWD
transmit "^M"

fopen 1 "C:\Procomm Plus 4.8\Capture\NEW_3902.csv" READ ;Change to the location of your file
if failure
usermsg "Could not open the file C:\Procomm Plus 4.8\Capture\NEW_3902.csv" ;Change to the location of your file
else
Transmit "****^M"
Transmit "LD 20^M" ;Go in to overlay 20

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@ EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT @@
;@@ Column1 / Column2 / Column3 / Column4 / Column5 / Column6 / Column7 / Column8 / Column9 / @@
;@@ TN / DES / TGAR / NCOS / RNPG / CLS / HUNT / KEY0 / CPND / @@
;@@ 12 0 0 1,DES1,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 5555,John Doe @@
;@@ 12 0 0 2,DES2,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 1000,John Doe @@
;@@ 12 0 0 3,DES3,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 2000,John Doe @@
;@@ 12 0 0 4,DES4,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 3000,John Doe @@
;@@ @@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

fseek 1 0 0
while 1
fgets 1 s0
if FEOF 1
exitwhile
endif
strtok s1 s0 "," 1 ;s1=TN
strtok s2 s0 "," 1 ;s2=DES
strtok s3 s0 "," 1 ;s3=TGAR
strtok s4 s0 "," 1 ;s4=NCOS
strtok s5 s0 "," 1 ;s5=RNPG
strtok s6 s0 "," 1 ;s6=CLS
strtok s7 s0 "," 1 ;s7=HUNT
strtok s8 s0 "," 1 ;s8=KEY 0
strtok s9 s0 "," 1 ;s9=CPND or NAME
DelStr (&s1)
DelStr (&s2)
DelStr (&s3)
DelStr (&s4)
DelStr (&s5)
DelStr (&s6)
DelStr (&s7)
DelStr (&s8)
DelStr (&s9)
DelLineFeed (&s9)
strlen s1 i0
if (i0 > 2)
LD20_NEW ()
else
halt
endif
endwhile
endif
endproc


proc LD20_NEW

waitfor "REQ"
transmit "NEW^M"
waitfor "TYPE:"
transmit "3902^M"
waitfor "TN "
transmit s1
transmit "^M"
waitfor "DES "
transmit s2
transmit "^M"
waitfor "CUST "
transmit "0^M"
waitfor "ERL "
transmit "^M"
waitfor "FDN "
transmit "^M"
waitfor "TGAR "
transmit s3
transmit "^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit s4
transmit "^M"
waitfor "RNPG "
transmit s5
transmit "^M"
waitfor "SSU "
transmit "^M"
waitfor "XLST "
transmit "^M"
waitfor "SCPW "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit s6
transmit "^M"
waitfor "RCO "
transmit "^M"
waitfor "HUNT "
transmit s7
transmit "^M"
waitfor "LHK "
transmit "^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 s8
transmit "^M"
waitfor " CPND "
transmit "NEW^M"
waitfor " NAME "
transmit s9
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
waitfor " VMB "
; transmit "^M"
waitfor "KEY "
transmit "1 cfw 5^M"
waitfor "KEY "
transmit "2 ao6^M"
waitfor "KEY "
transmit "3 rnp^M"
waitfor "KEY "
transmit "4 trn^M"
waitfor "KEY "
transmit "5 mwk 56245^M"
waitfor "KEY "
transmit "^M"
pause 1
return

endproc


proc DelStr
param string szStr
integer Pos
while 1
if StrFind szStr "`"" Pos
StrDelete szStr Pos 1
else
exitwhile
endif
endwhile
endproc

PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos
if (Pos > 2)
StrDelete szStr (Pos-1) 1
endif
endproc
 
phonemansam,

thanks i got the csv to work for a 3902. i tried to modify for a 3903 but i must have missed something. can you take a look.

proc main

set txpace 50 ;delay for keyboard



fopen 1 "C:\Program Files\Symantec\Procomm Plus\Aspect\NEW_3902.csv" READ ;Change to the location of your file
if failure
usermsg "Could not open the file C:\Procomm Plus 4.8\Capture\NEW_3902.csv" ;Change to the location of your file
else
Transmit "****^M"
Transmit "LD 11^M" ;Go in to overlay 11

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@ EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT / EXCEL CSV FILE FORMAT @@
;@@ Column1 / Column2 / Column3 / Column4 / Column5 / Column6 / Column7 / Column8 / Column9 / @@
;@@ TN / DES / TGAR / NCOS / RNPG / CLS / HUNT / KEY0 / CPND / @@
;@@ 12 0 0 1,DES1,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 5555,John Doe @@
;@@ 12 0 0 2,DES2,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 1000,John Doe @@
;@@ 12 0 0 3,DES3,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 2000,John Doe @@
;@@ 12 0 0 4,DES4,1,4,1,CTD PUA HTA TDD HFA MWA LNA CNDA,1234,0 SCR 3000,John Doe @@
;@@ @@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

fseek 1 0 0
while 1
fgets 1 s0
if FEOF 1
exitwhile
endif
strtok s1 s0 "," 1 ;s1=TN
strtok s2 s0 "," 1 ;s2=DES
strtok s3 s0 "," 1 ;s3=TGAR
strtok s4 s0 "," 1 ;s4=NCOS
strtok s5 s0 "," 1 ;s5=RNPG
strtok s6 s0 "," 1 ;s6=CLS
strtok s7 s0 "," 1 ;s7=HUNT
strtok s8 s0 "," 1 ;s8=KEY 0
strtok s9 s0 "," 1 ;s9=CPND or NAME
strtok s10 s0 "," 1 ;s10=KEY 1
strtok s11 s0 "," 1 ;s11= CPND or NAME
DelStr (&s1)
DelStr (&s2)
DelStr (&s3)
DelStr (&s4)
DelStr (&s5)
DelStr (&s6)
DelStr (&s7)
DelStr (&s8)
DelStr (&s9)
DelStr (&s10)
DelStr (&s11)
DelLineFeed (&s11)
strlen s1 i0
if (i0 > 2)
LD11_NEW ()
else
halt
endif
endwhile
endif
endproc


proc LD11_NEW

waitfor "REQ"
transmit "NEW^M"
waitfor "TYPE:"
transmit "3903^M"
waitfor "TN "
transmit s1
transmit "^M"
waitfor "DES "
transmit s2
transmit "^M"
waitfor "CUST "
transmit "0^M"
waitfor "ERL "
transmit "^M"
waitfor "FDN "
transmit "^M"
waitfor "TGAR "
transmit s3
transmit "^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit s4
transmit "^M"
waitfor "RNPG "
transmit s5
transmit "^M"
waitfor "SSU "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit s6
transmit "^M"
waitfor "RCO "
transmit "^M"
waitfor "HUNT "
transmit s7
transmit "^M"
waitfor "LHK "
transmit "^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 s8
transmit "^M"
waitfor " CPND "
transmit "NEW^M"
waitfor " NAME "
transmit s9
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
waitfor " VMB "
transmit "^M"
waitfor "KEY "
transmit s10
transmit "^M"
waitfor " CPND "
transmit "NEW^M"
waitfor " NAME "
transmit s11
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
waitfor " VMB "
transmit "^M"
transmit "2 adl^M"
waitfor "KEY "
transmit "3 adl^M"
waitfor "KEY "
transmit "16 mwk 4900^M"
waitfor "KEY "
transmit "^M"
pause 1
return

endproc


proc DelStr
param string szStr
integer Pos
while 1
if StrFind szStr "`"" Pos
StrDelete szStr Pos 1
else
exitwhile
endif
endwhile
endproc

PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos
if (Pos > 2)
StrDelete szStr (Pos-1) 1
endif
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top