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

Nortel Meridian - Create multiple extensions

Status
Not open for further replies.

speechan

Technical User
Mar 25, 2002
4
0
0
GB
I want to create 150 or so Meridian "phantom" extensions and have three colums of data. eg

TN DN DCFW

156 0 0 1 1234 90800123456
156 0 0 2 2345 912345678


When the script 'sees' TN, I want it to read "156 0 0 1", input this data, ^M, wait for DN and input 1234, ^M, wait for "ITEM", input FTR DCFW 12 space and then the data from the third column, eg 90800123456, ^M, then repeat but moving down one row, ie to 156 0 0 2.


Any ideas how to 'read' from two colums of data?

R
Speechan
 
I believe DDE is used to handle spreadsheet data..
Alas I know nothing about that.

SO ALTERNATIVELY... If 'twer me, I'd convert the file to Comma Seperated Format...If it's an xls spreadsheet just save it as csv. Then this script should work.



TN,DN,DCFW
156 0 0 1,1234,90800123456
156 0 0 2,2345,912345678

You just need to match the path to the csv file.

Code:
proc main


	string my_file = "C:\Path to yourfile\yourfile.csv"
	string LineInfo
	string TN_Str
	string DN_Str
	string DCFW_Str
	string TempStr
	
	when userexit call term ;user wants to exit

	fopen 0 my_file READ
	while not feof 0 ;loop to end of file
		fgets 0 LineInfo
	
		
		if strcspn LineInfo "1234567890" ;check if there are numbers in the line	
	
			strextract TN_Str LineInfo "," 0 ;get TN 
 			strextract DN_Str LineInfo "," 1 ;get DN 
			strextract DCFW_Str LineInfo "," 2 ;get DCFW
			
			strcat TN_Str "^M" ;add ENTER to string
			strcat DN_Str "^M" 
			strcat DCFW_Str "^M" 	
			
			transmit "^M" ;to see where we are at
			waitfor "REQ:" FOREVER ;ensure we have correct prompt
			transmit "NEW^M"
			waitfor "TYPE:" FOREVER
			transmit "500^M"
			;When the script 'sees' TN, I want it to read "156 0 0 1", input this data 
			waitfor "TN" FOREVER
			transmit TN_Str
			waitfor "CDEN" FOREVER
			transmit "^M"
			waitfor "DES" FOREVER
			transmit DN_Str ;Using the DN as the DES field
			waitfor "CUST" FOREVER
			transmit "0^M"
			waitfor "DN" FOREVER
			transmit DN_Str ;wait for DN and input 1234,
			waitfor "ITEM" FOREVER
			
			;input FTR DCFW 12 space data from the third column, eg 90800123456, ^M, 
			TempStr = "FTR DCFW 12 "
			strcat TempStr DCFW_Str
			transmit TempStr 						
      
			
		endif		
		


	endwhile	
fclose 0	

endproc

proc term
transmit "****^M" ;log out of LD
endproc




 
AFTERTHOUGHT... DELETE THIS LINE
transmit "^M" ;to see where we are at

It does mean you will need to press enter to start the script..but it also means as the script loops it will wait until it sees the "REQ:" prompt again...

Also, you may need some extra transmits after the input FTR line to come back to a REQ prompt.



 
I think the question to ask is where is the data coming from in the first place. Is it something under your control or are you receiving it in a particular format from someone else, a capture file, etc.?

 
A startingpoint:

1 - Start the Recorder in ProComm
2 - Program the first Phantom-set manualy (with REQ: NEW etc.)
3 - Stop the recorder when you get to the REQ: prompt again.

Now you have the body of the script.

Create a loop around this body that opens the file containing the data,
and read in the fields line by line into variables (E.G. DN, TN, DCFW) and use this
in the body of the script where you would normaly type them in.

Check the help-function for commands like: fopen, fclose, strextract
Hope this helps :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top