I would excel to make the text file as Knob describes above:
A B C D E
Router Ethernet Addr Ser0 IP Addr Ser1 IP Addr Dial Peer
Set E0 IP %s set S0 %s set S1 %s set peer dial %s
rtr 1 192.152.10.1 192.152.20.1 192.152.30.1 555-1212
rtr 2 192.152.20.1 192.152.10.1 192.152.30.1 555-1213
rtr 3 192.152.30.1 192.152.10.1 192.152.20.1 555-1214
Then save the Excel file as a CSV (comma separated variable) file. which will yield:
Router,Ethernet Addr,Ser0 IP Addr,Ser1 IP Addr,Dial Peer
rtr 1,192.152.10.1,192.152.20.1,192.152.30.1,555-1212
rtr 2,192.152.20.1,192.152.10.1,192.152.30.1,555-1213
rtr 1,192.152.30.1,192.152.10.1,192.152.20.1,555-1214
,Set E0 IP %s,set S0 %s,set S1 %s,set peer dial %s
proc main
string sLine, sItem, sCmds, cmd
integer iLen, cntr, Num_items
fopen 0 "c:\Rtr_data.csv" READ TEXT
fgets 0 sLine ; read the headings line from file
fgets 0 sCmds
while not feof 0
strlen sLine iLen
fgets 0 sLine ;read line of data from text file
if iLen == 0
exitwhile
endif
strextract sItem sLine "," 0 ; get the Rtr name
usermsg "Connect to the %s router craft port" sItem
; prompt you to connect your cable to the Rtr
#comment
; these lines can be substituted after the Rtrs are rolled out fro the usermsg cmd above also substituting an IP address for the router name
connectmanual telnet "ipaddress"
while $DIALING
yield
endwhile
#endcomment
strsearch sLine "," Num_items ;get the number of commas ie items in the sLine for the rtr
for cntr = 1 upto Num_Items
strextract sItem sLine "," cntr ; get next item from the line
strextract cmd sCmds "," cntr ; get cmd string for this item
strfmt cmd cmd sItem ; insert the Ip address from sItem into cmd where the %s is
transmit cmd
waitfor "prompt" 10 ;substitute the Rtr prompt for the word prompt
endfor
disconnect
endwhile
fclose 0
endproc
The one line limit per router will give you approximately 16 collumns of data with 16 characters per collumn. That is what IP addresses would max out as including the comma seperator. Telephone numbers would probably be a couple less unless you're using outside line access digits or pauses. Strtok as Knob mentioned is another way to pull data out of a delimited string but I tend to prefer strextract. Sorry if the Cisco IOS commands are way off but its been a year since I was delving into the cisco stuff.
Hope this helped. You could also add the login and setup your rollout passwords with the script as well.
DT