bobertperry
Programmer
Hello,
I am reading in a file into a string and then using that to set all sorts of vars. I am trying to add a way to be able to comment lines out with string start, string end, and string replace but I am getting all sorts or weird results. Would anyone please post an example?
Here is the code I want to insert it into. (not that it matters)
set number_of_routers 0
set inpid [open $IPs "r"]
for {set i 0} {![eof $inpid]} {incr i } {
gets $inpid regel
# edit coments out of $regel
foreach {this_name this_ip this_pass this_en_pass} $regel {}
set ipaddr($this_name) $this_ip
set routers_name($number_of_routers) $this_name
# set routers_ip($number_of_routers) $this_ip
set routers_pass($number_of_routers) $this_pass
if {$routers_pass($number_of_routers)==""} then {set routers_pass($i) $pass }
set routers_en_pass($number_of_routers) $this_en_pass
if {$routers_en_pass($number_of_routers)==""} then {set routers_en_pass($i) $en_pass }
incr number_of_routers
}
Thanks,
Rob
I am reading in a file into a string and then using that to set all sorts of vars. I am trying to add a way to be able to comment lines out with string start, string end, and string replace but I am getting all sorts or weird results. Would anyone please post an example?
Here is the code I want to insert it into. (not that it matters)
set number_of_routers 0
set inpid [open $IPs "r"]
for {set i 0} {![eof $inpid]} {incr i } {
gets $inpid regel
# edit coments out of $regel
foreach {this_name this_ip this_pass this_en_pass} $regel {}
set ipaddr($this_name) $this_ip
set routers_name($number_of_routers) $this_name
# set routers_ip($number_of_routers) $this_ip
set routers_pass($number_of_routers) $this_pass
if {$routers_pass($number_of_routers)==""} then {set routers_pass($i) $pass }
set routers_en_pass($number_of_routers) $this_en_pass
if {$routers_en_pass($number_of_routers)==""} then {set routers_en_pass($i) $en_pass }
incr number_of_routers
}
Thanks,
Rob