Hello all. I would like to create a script that would access a .csv file to add in a bunch of new CPND names in a CS1000E system
I have created this script below so far:
when it is run on the PBX in Procomm, it does this:
I have created this script below so far:
proc main
string sline, DN,NAME
fopen 0 "ACDCPND.CSV" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok DN sLine "`t" 1 ;Get the first field
strtok NAME sLine "`t" 1 ;Get the second field
set txpace 30
waitfor "req:"
transmit "new^M"
waitfor "type"
transmit "NAME^M"
waitfor "CUST "
transmit "0^M"
waitfor "DIG "
transmit "^M"
waitfor "DN "
transmit "^M"
waitfor " NAME "
transmit "^M"
waitfor " XPLN "
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
endwhile
fclose 0
endproc
string sline, DN,NAME
fopen 0 "ACDCPND.CSV" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok DN sLine "`t" 1 ;Get the first field
strtok NAME sLine "`t" 1 ;Get the second field
set txpace 30
waitfor "req:"
transmit "new^M"
waitfor "type"
transmit "NAME^M"
waitfor "CUST "
transmit "0^M"
waitfor "DIG "
transmit "^M"
waitfor "DN "
transmit "^M"
waitfor " NAME "
transmit "^M"
waitfor " XPLN "
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
endwhile
fclose 0
endproc
when it is run on the PBX in Procomm, it does this:
[/DISK SPACE NEEDED: 329 KBYTES
REQ new
TYPE NAME
CUST 0
DIG
DN
ENTR
DCNO
MEM AVAI
indent]
So obviously it isn't even accessing the file.
I do not know much about scripting, so any assistance would be greatly appreciated.
thanks.
REQ new
TYPE NAME
CUST 0
DIG
DN
ENTR
DCNO
MEM AVAI
indent]
So obviously it isn't even accessing the file.
I do not know much about scripting, so any assistance would be greatly appreciated.
thanks.