This script builds sets, you will have to tweak it for your PBX. If you read the top of the script it defines the fields for your Excel spreadsheet that it will pull from.
;Recorded script. Editing may be required.
;DESC OLDTN NEWTN TYPE ACD POSID DN NAME
;3905 4 0 13 2 4 0 13 2 3905 3700 554001 514011
;3905 4 0 12 15 4 0 12 15 554002 514002
;3905 4 0 13 15 4 0 13 15 554131 514131
proc main
string xdesc, xoldtn, xnewtn, xtype, xacd, xdn, xpos, xname ; variables to be extracted from input string from file.
string FName ; Declaration of File name to be opened.
string LineBuffer ; Declaration of variable LineBuffer for Line to be read from file.
string nloop = "True"
string LChar = "F"
integer nItem = 0, Len = 2 ; nItem - next comma delimited field in LineBuffer
statmsg "Enter the name of the source file that has DESC, OLDTN, NEWTN, TYPE, ACD, POSID, DN, and NAME defined."
sdlginput "Source File for 3905 Sets" "Enter File Name :" FName
if isfile FName ; Make sure file exists.
fopen 0 FName READ ; Open file for read.
while not feof 0
fgets 0 linebuffer
while not feof 0 ; Loop while not end of file.
statclear
statmsg "Processing file input"
strextract xdesc LineBuffer "," nItem ; Extract description from input string
if not nullstr xdesc ; See if we're at the end of list.
nItem++
;usermsg xdesc ; Increment our item pointer.
endif
strextract xoldtn LineBuffer "," nItem ; Extract tn from input string
if not nullstr xoldtn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xoldtn
endif
strextract xnewtn LineBuffer "," nItem ; Extract tn from input string
if not nullstr xnewtn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xnewtn
endif
strextract xtype LineBuffer "," nItem ; Extract tn from input string
if not nullstr xtype ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xtype
endif
strextract xacd LineBuffer "," nItem ; Extract acd from input string
if not nullstr xacd ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xacd
endif
strextract xpos LineBuffer "," nItem ; Extract DN from input string
if not nullstr xpos ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xpos
endif
strextract xdn LineBuffer "," nItem ; Extract position ID from input string
if not nullstr xdn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xdn
endif
strextract xname LineBuffer "," nItem ; Extract position ID from input string
if not nullstr xname ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xname
endif
;3905 code
if strcmp nloop "True"
transmit "ld 20^M"
endif
waitfor "REQ:"
transmit "new^M"
waitfor "TYPE: "
transmit xtype
transmit "^M"
waitfor "TN "
transmit xnewtn
transmit "^M"
waitfor "DES "
transmit xdesc
transmit "^M"
strright LChar xnewtn Len
if not strcmp LChar " 0"
waitfor "CTYP "
transmit "XDLC^M"
endif
waitfor "CUST "
transmit "0^M"
waitfor "KBA "
transmit "^M"
waitfor "DBA "
transmit "^M"
waitfor "FDN "
transmit "^M"
waitfor "TGAR "
transmit "1^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit "3^M"
waitfor "RNPG "
transmit "^M"
waitfor "SSU "
transmit "0000^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit "AGN HTD TDD LNA CNDA MCTA DNDA ICDA ^M"
waitfor "HUNT "
transmit "000^M"
waitfor "LHK "
transmit "1^M"
waitfor "LNRS "
transmit "^M"
waitfor "SCI "
transmit "^M"
waitfor "PLEV "
transmit "2^M"
waitfor "SPID "
transmit "^M"
waitfor "AST "
transmit "00 01^M"
waitfor "IAPG "
transmit "1^M"
waitfor "ITNA "
transmit "^M"
waitfor "PRI "
transmit "^M"
waitfor "MLNG "
transmit "^M"
waitfor "DNDR "
transmit "^M"
waitfor "KEY "
transmit "0 acd "
transmit xacd
transmit " 0 "
transmit xpos
transmit "^M"
waitfor "KEY "
transmit "1 scr "
transmit xdn
transmit " 0^M"
waitfor "CPND"
transmit "^M"
waitfor "VMB"
transmit "^M"
waitfor "KEY "
transmit "2 trc^M"
waitfor "KEY "
transmit "8 msb^M"
waitfor "KEY "
transmit "9 nrd^M"
waitfor "KEY "
transmit "10 dwc "
transmit xacd
transmit "^M"
waitfor "KEY "
transmit "11 acnt^M"
waitfor "KEY"
transmit "12 nul^M"
waitfor "KEY"
transmit "13 nul^M"
waitfor "KEY"
transmit "14 nul^M"
waitfor "KEY "
transmit "19 NUL^M"
waitfor "KEY"
transmit "16 nul^M"
waitfor "KEY "
transmit "20 NUL^M"
waitfor "KEY "
transmit "21 NUL^M"
waitfor "KEY "
transmit "22 NUL^M"
waitfor "KEY "
transmit "23 SSU 0000^M"
waitfor "KEY "
transmit "24 NUL^M"
waitfor "KEY "
transmit "25 NUL^M"
waitfor "KEY "
transmit "26 NUL^M"
waitfor "KEY "
transmit "^M"
nloop = "False"
NItem = 0
fgets 0 linebuffer
endwhile
endwhile
waitfor "REQ:"
transmit "****^M"
fclose 0 ; Close file opened for read.
statclear
else
errormsg "Couldn't open file `"%s`"." FName
statclear
endif
endproc
JohnThePhoneGuy
"If I can't fix it, it's not broke!